Text
Introduction
Text objects have a Text property which controls the displayed text. By default this value is set to "Hello".
Changing Text
The Text property can be changed in the multi-line edit window.

Text will wrap according to the Text object's Width.

The enter key can be used to add new lines to text.

Text Wrapping
Text instances can optionally wrap their text based on width units. By default Text instances use a Width Units
of Relative to Children
which means the text does not wrap.

This Width Units results in the Text automatically resizing itself in response to its Text variable, resulting in no wrapping.

Any other Width Unit
can be used to make the text wrap. For example, setting Width Units
to Absolute
and changing Width
results in wrapping.

For a deeper dive into Width Units, see the Width Units page.
The current version of Gum only wraps text on space and newline characters. Future versions of Gum will introduce support for breaking words apart if they extend beyond the bounds of the Text instance.
Using BBCode for Inline Styling
Gum text supports inline styling using BBCode-like syntax. To add inline styling, surround text with variable assignment tags as shown in the following screenshot:

The following table shows the available variables that can be used for inline styling:
Color
This is [Color=orange]orange[/Color] text.
Red Green Blue
This is [Red=0][Green=128][Blue=255]light blue[/Red][/Green][/Blue] text.
FontScale
This is [FontScale=2]big[/FontScale] text.
IsBold
This is [IsBold=true]bold[/IsBold] text.
IsItalic
This is [IsItalic=true]italic[/IsItalic] text.
Font
This is [Font=Papyrus]Papyrus[/Font] text.
FontSize
This is [FontSize=36]bigger[/FontSize] text.
OutlineThickness
This is [OutlineThickness=2]outlined[/OutlineThickness] text.
Note that changing Font and FontSize results in new Fonts created in the Font Cache.
BBCode can span multiple lines, whether the newlines happen due to line wrapping or through the addition of newlines in the text.

Multiple tags can overlap each other allowing you to combine tags for a single piece of text. For example, the following sets text to both bold and orange:
This is [Color=Orange][IsBold=true]bold and orange[/Color][/IsBold] text.

Styles can contain other styles as many levels deep as necessary.
This [Color=Orange]is orange, [IsBold=true]bold[/IsBold], and [IsItalic=true]italic[/IsItalic][/Color] text.

Last updated
Was this helpful?