Text#
- class Text#
A text label. Added to a
Canvasor aPanel.- RectTransform RectTransform { get; }#
The rect transform for the UI object.
- Game Scenes:
All
- LayoutElement LayoutElement { get; }#
How much space the UI object asks a layout for.
- Game Scenes:
All
Note
Only has an effect when the object is in a panel that has a layout. A canvas is not inside a layout and does not have one.
- bool Visible { get; set; }#
Whether the UI object is visible.
- Game Scenes:
All
Note
This is the object’s own setting, which is what it was last set to. An object is only drawn when everything it is inside is visible as well, so an interface can be built with its parts visible, inside a panel that is not, and shown all at once by making that panel visible.
- bool WordWrap { get; set; }#
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.
- Game Scenes:
All
- string Font { get; set; }#
Name of the font
- Game Scenes:
All
Note
Empty if the game provided no font to draw the text with, in which case it is not drawn. See
Text.AvailableFontsfor the names that can be set.
- StdLib.ColorRGBA Color { get; set; }#
The color the text is drawn in.
- Game Scenes:
All
- TextAnchor Alignment { get; set; }#
Alignment.
- Game Scenes:
All
- void Remove ()#
Remove the UI object.
- Game Scenes:
All
- enum FontStyle#
Font style.
- Normal#
Normal.
- Bold#
Bold.
- Italic#
Italic.
- BoldAndItalic#
Bold and italic.