Text

class Text

A text label. See Panel.add_text().

rect_transform

The rect transform for the text.

Attribute:Read-only, cannot be set
Return type:RectTransform
Game Scenes:All
visible

Whether the UI object is visible.

Attribute:Can be read or written
Return type:bool
Game Scenes:All
content

The text string

Attribute:Can be read or written
Return type:str
Game Scenes:All
font

Name of the font

Attribute:Can be read or written
Return type:str
Game Scenes:All
available_fonts

A list of all available fonts.

Attribute:Read-only, cannot be set
Return type:list(str)
Game Scenes:All
size

Font size.

Attribute:Can be read or written
Return type:int
Game Scenes:All
style

Font style.

Attribute:Can be read or written
Return type:FontStyle
Game Scenes:All
color

Set the color

Attribute:Can be read or written
Return type:tuple(double, double, double)
Game Scenes:All
alignment

Alignment.

Attribute:Can be read or written
Return type:TextAnchor
Game Scenes:All
line_spacing

Line spacing.

Attribute:Can be read or written
Return type:float
Game Scenes:All
remove()

Remove the UI object.

Game Scenes:All
class FontStyle

Font style.

normal

Normal.

bold

Bold.

italic

Italic.

bold_and_italic

Bold and italic.

class TextAlignment

Text alignment.

left

Left aligned.

right

Right aligned.

center

Center aligned.

class TextAnchor

Text alignment.

lower_center

Lower center.

lower_left

Lower left.

lower_right

Lower right.

middle_center

Middle center.

middle_left

Middle left.

middle_right

Middle right.

upper_center

Upper center.

upper_left

Upper left.

upper_right

Upper right.