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

visible

Whether the UI object is visible.

Attribute:

Can be read or written

Return type:

bool

content

The text string

Attribute:

Can be read or written

Return type:

str

font

Name of the font

Attribute:

Can be read or written

Return type:

str

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

style

Font style.

Attribute:

Can be read or written

Return type:

FontStyle

color

Set the color

Attribute:

Can be read or written

Return type:

tuple(float, float, float)

alignment

Alignment.

Attribute:

Can be read or written

Return type:

TextAnchor

line_spacing

Line spacing.

Attribute:

Can be read or written

Return type:

float

remove()

Remove the UI object.

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.