Skip to main content

Text

The Text class is a component which interacts with Unity Text on UI and 3D.

caution

The Text class is only compatible with TextMeshPro.

To get a Text component from an item, use the GetComponent method.

let textComponent = item.GetComponent("Text")

You can then use the textComponent property to access the Text class.

Methods​

Method NameReturn TypeParametersDescription
GetTextstringnoneGets the current text
SetTextvoidstringSets the current text

Properties​

Property NameTypeDescription
EnabledboolChecks the active state of the component
RichTextboolWhether or not the Text component can use RichText