Skip to content

API > Text


Text⚓︎

Text inherits from Component

The default Graphic to draw font data to screen.

Members⚓︎

Properties⚓︎

Name Description
Text.alignByGeometryProperty Use the extents of glyph geometry to perform horizontal alignment rather than glyph metrics.
Text.alignmentProperty The positioning of the text reliative to its RectTransform.
Text.colorProperty The text color
Text.fontSizeProperty The size that the Font should render at.
Text.fontStyleProperty FontStyle used by the text.
Text.lineSpacingProperty Line spacing, specified as a factor of font line height. A value of 1 will produce normal line spacing.
Text.supportRichTextProperty Whether this Text will support rich text.
Text.textProperty The string value this Text displays.

Inherited Members⚓︎

Inherited Properties⚓︎

Name Description
Text.gameObjectPropertyReadonly Property The game object this component is attached to. A component is always attached to a game object.
Text.tagPropertyReadonly Property The tag of this game object.
Text.transformPropertyReadonly Property The Transform attached to this GameObject.
Text.hideFlagsProperty Should the object be hidden, saved with the Scene or modifiable by the user?
Text.nameProperty The name of the object.

Inherited Methods⚓︎

Name Description
Text.BroadcastMessage(methodName, parameter=nil)Method Calls the method named methodName on every Lua Script in this game object or any of its children.
Text.CompareTag(tag)Method Is this game object tagged with tag ?
Text.GetAllLuaScripts()Method Returns an array of all Lua scripts that attached to the game object.
Text.GetComponent(type)Method Returns the component of Type type if the game object has one attached, nil if it doesn't.
Text.GetComponentInChildren(t)Method Returns the component of Type type in the GameObject or any of its children using depth first search.
Text.GetComponentInParent(t)Method Returns the component of Type type in the GameObject or any of its parents.
Text.GetComponents(type)Method Returns all components of Type type in the GameObject.
Text.GetComponentsInChildren(t)Method Returns all components of Type type in the GameObject or any of its children.
Text.GetComponentsInParent(t)Method Returns all components of Type type in the GameObject or any of its parents.
Text.SendMessage(methodName, value=nil)Method Calls the method named methodName on every Lua Script in this game object.
Text.SendMessageUpwards(methodName, value=nil)Method Calls the method named methodName on every LuaScript in this game object and on every ancestor of the behaviour.
Text.TryGetComponent(type)Method Gets the component of the specified type, if it exists.
Text.GetInstanceID()Method Returns the instance id of the object.