Text#
- class Text#
A text label. Added to a
Canvasor aPanel.Base class:ObjectInherited Members
From
Object:rect_transform,layout_element,visible,remove()
- content#
The text string
- Attribute:
Can be read or written
- Return type:
str
- word_wrap#
Whether the text wraps onto further lines when it is wider than the space it has. Text that does not wrap carries on past the edge, and its preferred size is that of a single line, so a changing value leaves a layout in place.
- Attribute:
Can be read or written
- Return type:
bool
- font#
Name of the font
- Attribute:
Can be read or written
- Return type:
str
Note
Empty if the game provided no font to draw the text with, in which case it is not drawn. See
Text.available_fontsfor the names that can be set.
- available_fonts#
A list of all available fonts.
- Attribute:
Read-only, cannot be set
- Return type:
list(str)
- size#
Font size.
- Attribute:
Can be read or written
- Return type:
int
- color#
The color the text is drawn in.
- Attribute:
Can be read or written
- Return type:
- alignment#
Alignment.
- Attribute:
Can be read or written
- Return type:
- line_spacing#
Line spacing.
- Attribute:
Can be read or written
- Return type:
float
- class FontStyle#
Font style.
- normal#
Normal.
- bold#
Bold.
- italic#
Italic.
- bold_and_italic#
Bold and italic.