From fa7bf9fb19a5473a49754445cc0df303bd03b733 Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Tue, 11 Aug 2026 22:49:00 +0200 Subject: [PATCH 1/3] Update Text Styling docs --- Guides/Text-Styling.md | 289 +++++++++++++++++++++++------------------ 1 file changed, 160 insertions(+), 129 deletions(-) diff --git a/Guides/Text-Styling.md b/Guides/Text-Styling.md index 13ffc697..e2b30fe4 100644 --- a/Guides/Text-Styling.md +++ b/Guides/Text-Styling.md @@ -168,9 +168,18 @@ Valid style modifiers are as follows: --- -## Defined text colour modifier `{C:}` +## Text colour modifiers `{C:}`/`{V:}` -{C:colour-key} changes the color of the text, where *`colour-key`* is the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table). +{C:colour} or {V:colour} changes the color of the text, where *`colour`* is one of the following: + +- the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table), + +- a 6-digit **RGB hex code** or an 8-digit **RGBA hex code**, or + +- the index of a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. + +> [!NOTE] +> This functionality was added by Steamodded in (RELEASE). In older versions and in vanilla Balatro, `{C:}` only supports the first option, and `{V:}` only supports the third option. ### Examples @@ -200,7 +209,7 @@ Valid style modifiers are as follows: ```pas -{C:attention}1{} free {C:green}Reroll{} +{C:attention}1{} free {V:green}Reroll{} ``` @@ -237,18 +246,74 @@ Valid style modifiers are as follows: + + + + + ```pas + {C:ff00ff}FF00FF{} + ``` + + + + FF00FF + + + + + + + ```pas + {V:2}#2#{} suit{} + ``` + + + + + ```lua + vars = { + 'Spade', + 'Heart', + 'Club', + 'Diamond', + colours = { + G.C.SUITS.Spades, + G.C.SUITS.Hearts, + G.C.SUITS.Clubs, + G.C.SUITS.Diamonds + } + } + ``` + + + + + + Heart suit + + + -## Defined background colour modifier `{X:}` +## Background colour modifiers `{X:}`/`{B:}` + +{X:colour} or {B:colour} sets the background color of the text, where *`colour-key`* is one of the following: + +- the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table), -{X:colour-key} sets the background color of the text, where *`colour-key`* is the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table). +- a 6-digit **RGB hex code** or an 8-digit **RGBA hex code**, or + +- the index of a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. + +> [!NOTE] +> This functionality was added by Steamodded in (RELEASE). In older versions and in vanilla Balatro, `{X:}` only supports the first option. `{B:}` is not supported by vanilla Balatro; in older Steamodded versions, it only supports the third option. -This modifier is usually combined with the text colour modifier to make +These modifiers are usually combined with a text colour modifier to make X3 Mult labels. -This modifier uniquely strips all whitespace from the styled text, so text like {X:gold} W I D E {} is rendered as WIDE. This can be helpful for improving the readability of otherwise dense strings. +The `{X:}` modifier uniquely strips all whitespace from the styled text, so text like {X:gold} W I D E {} is rendered as WIDE. This can be helpful for improving the readability of otherwise dense strings. The `{B:}` modifier instead leaves the styled text's whitespace unmodified. ### Examples @@ -260,7 +325,7 @@ This modifier uniquely strips all whitespace from the styled text, so text like ```pas - {X:mult,C:white}X3{} Mult{} + {B:mult,C:white}X3{} Mult{} ``` @@ -309,108 +374,12 @@ This modifier uniquely strips all whitespace from the styled text, so text like X0.5 - - -## Variable/custom text colour modifier `{V:}` - -{V:index} changes the colour of the text to a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. - -*`index`* is the array index of the colour entry in the `vars.colours` table. - -### Examples - - - - - - - - - - - - - - -
Text string loc_vars Result
- - ```pas - {V:1}FF00FF{} - ``` - - - - ```lua - vars = { - colours = { HEX('FF00FF') } - } - ``` - - - FF00FF -
- - ```pas - {V:2}#2#{} suit{} - ``` - - - - ```lua - vars = { - 'Spade', - 'Heart', - 'Club', - 'Diamond', - colours = { - G.C.SUITS.Spades, - G.C.SUITS.Hearts, - G.C.SUITS.Clubs, - G.C.SUITS.Diamonds - } - } - ``` - - - - - Heart suit - -
- -## Variable/custom background colour modifier `{B:}` -> -> [!NOTE] -> This modifier is added by Steamodded and is not supported by vanilla Balatro. - -{B:index} changes the colour of the background to a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. - -*`index`* is the array index of the colour entry in the `vars.colours` table. - -Unlike the similar [Defined background modifier `{X:}`](#defined-background-colour-modifier-x), `{B:}` does **not** remove or change the whitespace of styled text, so displayed contents will remain the same as their input string. - -### Examples - - - - - - - - @@ -451,7 +420,7 @@ Unlike the similar [Defined background modifier `{X:}`](#defined-background-colo @@ -475,13 +444,14 @@ Unlike the similar [Defined background modifier `{X:}`](#defined-background-colo
Text string loc_vars Result
+ ```pas - {B:1}00FF00{} - ``` - - - - ```lua - vars = { - colours = { HEX('00FF00') } - } + {B:00ff00}00FF00{} ``` ```pas - {B:1,V:2}#1#{B:2,V:1}#2#{} + {B:1,V:2}#1#{B:2,C:1}#2#{} ```
+ ## Text motion modifier `{E:}` `{E:1}` applies a pop-in effect when the text is first displayed, and a floating animation to each letter in the text. `{E:2}` applies a bumping animation to each letter in sequence. -`{E:}` is incompatible with background modifiers `{X:}` and `{B:}`. If background modifiers are set, `{E:1}` will only show a pop-in effect with no motion, and `{E:2}` will be ignored. +`{E:}` is fully compatible with background modifiers `{X:}` and `{B:}` *(Added by Steamodded)*. In vanilla Balatro, if background modifiers are set, `{E:1}` will only show a pop-in effect with no motion, and `{E:2}` will be ignored. You can also apply a custom effect using [SMODS.DynaTextEffect](https://docs.smods.dev/Game%20Objects/SMODS.DynaTextEffect), in that case the modifier should be `{E:modprefix_key}`. @@ -536,7 +506,10 @@ You can also apply a custom effect using [SMODS.DynaTextEffect](https://docs.smo ## Text hover tooltip modifier `{T:}` -{T:tooltip-key} adds tooltip functionality to the text, which displays a small tooltip UI above the text when the text is hovered over. If `tooltip-key` can be the name of a key found in either `G.P_CENTERS` or `G.P_TAGS` or a description found in `G.localization.descriptions.Other`. *(Added in 1814a)* You can additionally use `T_set:set-key` to specify a set in `G.localization.descriptions` to pull from, and `T_vars:var1;var2;...` to replace any localizarion variables in the text. +{T:tooltip-key} adds tooltip functionality to the text, which displays a small tooltip UI above the text when the text is hovered over. If `tooltip-key` can be the name of a key found in either `G.P_CENTERS` or `G.P_TAGS` or a description found in `G.localization.descriptions.Other` *(Added in 1814a)*. In the latter case, you can supply additional information as follows: {T:[key=tooltip-key;set=set-key;1=var1;2=var2;...]} *(Added in (RELEASE))*. The *set-key* is used to specify a set in `G.localization.descriptions` to pull from, and the variables *var1*, *var2*, etc. are used to supply any localization variables in the text. + +> [!NOTE] +> The same effect can be achieved using {T:tooltip-key,T_set:set-key,T_vars=var1;var2;...} *(added in 1814a)*. ### Examples @@ -562,7 +535,7 @@ You can also apply a custom effect using [SMODS.DynaTextEffect](https://docs.smo

```pas - "Shop can have {C:perishable,T:perishable,T_vars:5;5}Perishable{} Jokers" + "Shop can have {C:perishable,T:[key=perishable;1=5;2=5]}Perishable{} Jokers" ``` @@ -575,7 +548,7 @@ You can also apply a custom effect using [SMODS.DynaTextEffect](https://docs.smo

```pas - "{T_set:Blind,T:bl_arm}The Arm{}" + "{T:[key=bl_arm;set=Blind]}The Arm{}" ``` @@ -619,17 +592,29 @@ Vanilla Balatro only uses `s:0.8`, `s:0.85` and `s:1.1` text scales. -## Text underline modifier `{u:}` +## Text underline, strikethrough and overline modifiers `{u:}`/`{st:}`/`{ov:}` > > [!NOTE] -> This modifier is added by Steamodded and is not supported by vanilla Balatro. +> These modifiers are added by Steamodded and are not supported by vanilla Balatro. +> *(Added in (RELEASE))* > [!IMPORTANT] -> This modifier requires the **lowercase** `u`, unlike other modifiers which must be UPPERCASE. +> These modifiers must be **lowercase**, unlike other modifiers which must be UPPERCASE. + +### Basic usage + +{u:colour}, {st:colour} and {ov:colour} respectively add an underline, strikethrough, or underline to the text. The width of the line is 10% of the text's height. + +*`colour`* sets the colour of the line, where *`colour`* is one of the following: +- the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table), -{u:colour-key} adds an underline under the text. +- a 6-digit **RGB hex code** or an 8-digit **RGBA hex code**, or -*`colour-key`* sets the colour of the underline, where *`colour-key`* is the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table). +- the index of a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. + +### Advanced usage + +By supplying a table to the text modifier, it is possible to customize the lines further: {u:[c=colour;s=size]}. *size* is a decimal value with a default of `0.1`. It indicates the thickness of the line relative to the height of the text. It is **required** to specify a *colour*. ### Examples @@ -644,6 +629,32 @@ Vanilla Balatro only uses `s:0.8`, `s:0.85` and `s:1.1` text scales. {u:red}Underlined text! ``` + + + TBD + + + + + + + ```pas + {st:[c=green;s=0.2]}Thick strikethrough text! + ``` + + + + TBD + + + + + + + ```pas + {ov:[c=blue;s=0.05]}Thin overlined text! + ``` + TBD @@ -651,18 +662,27 @@ Vanilla Balatro only uses `s:0.8`, `s:0.85` and `s:1.1` text scales. -## Text strikethrough modifier `{st:}` +## Text outline modifier `{O:}` > > [!NOTE] > This modifier is added by Steamodded and is not supported by vanilla Balatro. -> *(Added in 1531zeebee)* +> *(Added in (RELEASE))* -> [!IMPORTANT] -> This modifier requires the **lowercase** `st`, unlike other modifiers which must be UPPERCASE. +### Basic usage + +{O:colour} adds an outline to the text. -{st:colour-key} adds a strikethrough line through the text. +*`colour`* sets the colour of the line, where *`colour`* is one of the following: -*`colour-key`* sets the colour of the underline, where *`colour-key`* is the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table). +- the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table), + +- a 6-digit **RGB hex code** or an 8-digit **RGBA hex code**, or + +- the index of a custom colour provided as an entry in the [`loc_vars`](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) `vars.colours` table. See [Localization](https://docs.smods.dev/API%20Documentation/Localization#loc_vars) for more details. + +### Advanced usage + +By supplying a table to the text modifier, it is possible to customize the outline further: {O:[c=colour;s=size]}. *size* is a decimal value with a default of `1.0`. It indicates the thickness of the outline. **Due to implementation constraints, large *size* values may lead to unexpected results.** It is **required** to specify a *colour*. ### Examples @@ -674,7 +694,20 @@ Vanilla Balatro only uses `s:0.8`, `s:0.85` and `s:1.1` text scales. ```pas - {st:red}Strikethrough text! + {O:red}Outlined text! + ``` + + + + TBD + + + + + + + ```pas + {C:blue,O:[c=green;s=0.6]}Thinner outline! ``` @@ -977,13 +1010,9 @@ Vanilla Balatro only uses `s:0.8`, `s:0.85` and `s:1.1` text scales. ## Combinations -Some style codes can be combined within one set of curly braces, like `{X:mult,C:white}`. +Most style codes can be combined within one set of curly braces, like `{X:mult,C:white}`. -- `{T:}`, `{f:}`, `{u:}`, `{button:}` and `{s:}` are compatible with all other modifiers. - -- Background modifiers `{X:}` or `{B:}` can be used in conjunction with text colour modifiers `{C:}` or `{V:}`. - -- Text motion modifier `{E:}` is incompatible with background modifiers `{X:}` and `{B:}` - if background modifiers are set, `{E:1}` will only show a pop-in effect with no motion, and `{E:2}` will be ignored. +- All combinations that aren't explicitly listed here are valid. - `{C:}` and `{V:}` are exclusive - if both are used, `{C:}` will be ignored. @@ -991,6 +1020,8 @@ Some style codes can be combined within one set of curly braces, like `{X:mult,C - `{element:}` does not interact with any other modifiers. Any additional modifiers will function as if `{element:}` wasn't present. +- **In vanilla Balatro only**, the text motion modifier `{E:}` is incompatible with background modifiers `{X:}` and `{B:}` - if background modifiers are set, `{E:1}` will only show a pop-in effect with no motion, and `{E:2}` will be ignored. Modern versions of Steamodded fully lift this restriction. + ### Examples From abf22b206226c4ebe3a189c678126fe1d786efbf Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Tue, 11 Aug 2026 22:57:47 +0200 Subject: [PATCH 2/3] Update table of contents --- Guides/Text-Styling.md | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/Guides/Text-Styling.md b/Guides/Text-Styling.md index e2b30fe4..0fc73ba6 100644 --- a/Guides/Text-Styling.md +++ b/Guides/Text-Styling.md @@ -59,77 +59,77 @@ Valid style modifiers are as follows:
- + @@ -297,7 +297,7 @@ Valid style modifiers are as follows: ## Background colour modifiers `{X:}`/`{B:}` -{X:colour} or {B:colour} sets the background color of the text, where *`colour-key`* is one of the following: +{X:colour} or {B:colour} sets the background color of the text, where *`colour`* is one of the following: - the **key** of a colour defined in [`G.ARGS.LOC_COLOURS`](#loc_colours-table), @@ -1557,4 +1557,4 @@ Steamodded automatically adds additional entries to `LOC_COLOURS` for all custom - [SMODS.ConsumableType](https://docs.smods.dev/Game%20Objects/SMODS.Center/SMODS.Consumable) - [SMODS.Suit](https://docs.smods.dev/Game%20Objects/SMODS.Rank-and-SMODS.Suit#api-documentation-smodssuit) -which can be used as colour keys in the same way by `{C:}` and `{X:}`. When referring to custom Rarity, Gradient or Suit colours added by SMODS, the key must be prefixed with the [mod prefix](https://docs.smods.dev/API%20Documentation/Mod-Metadata#metadata). +which can be used as colour keys in the same way by `{C:}`/`{V:}` and `{X:}`/`{B:}`. When referring to custom Rarity, Gradient or Suit colours added by SMODS, the key must be prefixed with the [mod prefix](https://docs.smods.dev/API%20Documentation/Mod-Metadata#metadata). From 0524c7c43738f3a54304e802d22eeaf7baea87bd Mon Sep 17 00:00:00 2001 From: Casimir Eisenach Date: Tue, 11 Aug 2026 22:58:39 +0200 Subject: [PATCH 3/3] oops --- Guides/Text-Styling.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Guides/Text-Styling.md b/Guides/Text-Styling.md index 0fc73ba6..55b2aafd 100644 --- a/Guides/Text-Styling.md +++ b/Guides/Text-Styling.md @@ -123,7 +123,7 @@ Valid style modifiers are as follows:
- Defined text colour + Text colour - {C:colour-key} + {C:colour}/{V:colour}
- Defined background colour + Background colour - {X:colour-key} + {X:colour}/{B:colour}
- Variable/custom text colour + Text motion - {V:colour-index} + {E:motion-index}
- Variable/custom background colour + Text hover tooltip - {B:colour-index} + {T:tooltip-key}
- Text motion + Text scale - {E:motion-index} + {s:scale}
- Text hover tooltip + Text underline - {T:tooltip-key} + {u:colour}
- Text scale + Text strikethrough - {s:scale} + {st:colour}
- Text underline + Text overline - {u:colour-key} + {ov:colour}
- Text strikethrough + Text overline - {st:colour-key} + {O:colour}
Font
- Text overline + Text outline {O:colour}