Text

class Text

A text label. See Panel::add_text().

RectTransform rect_transform()

The rect transform for the text.

bool visible()
void set_visible(bool value)

Whether the UI object is visible.

std::string content()
void set_content(std::string value)

The text string

std::string font()
void set_font(std::string value)

Name of the font

std::vector<std::string> available_fonts()

A list of all available fonts.

int32_t size()
void set_size(int32_t value)

Font size.

FontStyle style()
void set_style(FontStyle value)

Font style.

std::tuple<double, double, double> color()
void set_color(std::tuple<double, double, double> value)

Set the color

TextAnchor alignment()
void set_alignment(TextAnchor value)

Alignment.

float line_spacing()
void set_line_spacing(float value)

Line spacing.

void remove()

Remove the UI object.

enum struct FontStyle

Font style.

enumerator normal

Normal.

enumerator bold

Bold.

enumerator italic

Italic.

enumerator bold_and_italic

Bold and italic.

enum struct TextAlignment

Text alignment.

enumerator left

Left aligned.

enumerator right

Right aligned.

enumerator center

Center aligned.

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.