Text#
-
class Text#
A text label. Added to a
Canvasor aPanel.Base class:ObjectInherited Members
From
Object:rect_transform,layout_element,visible,set_visible,remove
-
std::string content()#
-
void set_content(std::string value)#
The text string
-
bool word_wrap()#
-
void set_word_wrap(bool value)#
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.
-
std::string font()#
-
void set_font(std::string value)#
Name of the font
Note
Empty if the game provided no font to draw the text with, in which case it is not drawn. See
Text::available_fonts()for the names that can be set.
-
std::vector<std::string> available_fonts()#
A list of all available fonts.
-
int32_t size()#
-
void set_size(int32_t value)#
Font size.
-
TextAnchor alignment()#
-
void set_alignment(TextAnchor value)#
Alignment.
-
float line_spacing()#
-
void set_line_spacing(float value)#
Line spacing.
-
enum struct FontStyle#
Font style.
-
enumerator normal#
Normal.
-
enumerator bold#
Bold.
-
enumerator italic#
Italic.
-
enumerator bold_and_italic#
Bold and italic.
-
enumerator normal#
-
enum struct TextAlignment#
Text alignment.
-
enumerator left#
Left aligned.
-
enumerator right#
Right aligned.
-
enumerator center#
Center aligned.
-
enumerator left#
-
enum struct TextAnchor#
Text alignment.
-
enumerator lower_center#
Lower center.
-
enumerator lower_left#
Lower left.
-
enumerator lower_right#
Lower right.
-
enumerator middle_center#
Middle center.
-
enumerator middle_left#
Middle left.
-
enumerator middle_right#
Middle right.
-
enumerator upper_center#
Upper center.
-
enumerator upper_left#
Upper left.
-
enumerator upper_right#
Upper right.
-
enumerator lower_center#