Skip to main content

TextInput

info
  • This class is only available in a Local environment

The TextInput class is a component which interacts with Unity TextFields on UI.

caution

The TextInput class is only compatible with TextMeshPro.

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

let textinputComponent = item.GetComponent("TextInput")

You can then use the textinputComponent property to access the TextInput class.

Methods

Method NameReturn TypeParametersDescription
RegisterInputFieldVRvoidnoneAllows the TextInput to be interacted with in VR
GetTextstringnoneGets the current text
SetTextvoidstringSets the current text
GetPlaceholderTextstringnoneGets the current placeholder's text
SetPlaceholderTextvoidstringSets the current placeholder's text
RegisterTextChangedvoidfunction(string)Registers an event for when the TextInput is changed
RemoveAllTextChangedvoidnoneRemoves all registered events for when a TextInput is changed
GetColorBlockColorBlock?noneGets the ColorBlock for the element
SetColorBlockvoidColorBlockSets the ColorBlock for the element

Properties

Property NameTypeDescription
RichTextboolWhether or not the TextInput component can use RichText
PlaceholderRichTextboolWhether or not the TextInput's placeholder can use RichText