Text
7/14/25About 1 min
Text
Info
Text inherits from [Component](/docs/create/lua/API/Component/index.html)
The default Graphic to draw font data to screen.
Members
Properties
| Name | Description |
|---|---|
Text.alignByGeometry | Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics. |
Text.alignment | The positioning of the text reliative to its RectTransform. |
Text.color | The text color |
Text.fontSize | The size that the Font should render at. |
Text.fontStyle | FontStyle used by the text. |
Text.lineSpacing | Line spacing, specified as a factor of font line height. A value of 1 will produce normal line spacing. |
Text.supportRichText | Whether this Text will support rich text. |
Text.text | The string value this Text displays. |
Inherited Members
Inherited Properties
| Name | Description |
|---|---|
Text.gameObject | The game object this component is attached to. A component is always attached to a game object. |
Text.tag | The tag of this game object. |
Text.transform | The Transform attached to this GameObject. |
Text.hideFlags | Should the object be hidden, saved with the Scene or modifiable by the user? |
Text.name | The name of the object. |
Inherited Methods
| Name | Description |
|---|---|
Text.BroadcastMessage(methodName, parameter=nil) | Calls the method named methodName on every Lua Script in this game object or any of its children. |
Text.CompareTag(tag) | Is this game object tagged with tag ? |
Text.GetAllLuaScripts() | Returns an array of all Lua scripts that attached to the game object. |
Text.GetComponent(type) | Returns the component of Type type if the game object has one attached, nil if it doesn't. |
Text.GetComponentInChildren(t) | Returns the component of Type type in the GameObject or any of its children using depth first search. |
Text.GetComponentInParent(t) | Returns the component of Type type in the GameObject or any of its parents. |
Text.GetComponents(type) | Returns all components of Type type in the GameObject. |
Text.GetComponentsInChildren(t) | Returns all components of Type type in the GameObject or any of its children. |
Text.GetComponentsInParent(t) | Returns all components of Type type in the GameObject or any of its parents. |
Text.SendMessage(methodName, value=nil) | Calls the method named methodName on every Lua Script in this game object. |
Text.SendMessageUpwards(methodName, value=nil) | Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour. |
Text.TryGetComponent(type) | Gets the component of the specified type, if it exists. |
Text.GetInstanceID() | Returns the instance id of the object. |

