void OnValueChanged (Closure callback)
Given function will be called when text in Input Field has changed
void OnEndEdit (Closure callback)
Given function will be called when editing has ended
void ActivateInputField ()
Function Description
void DeactivateInputField ()
Function Description
void Select ()
Function Description
string Text get set
The current value of the input field.
bool Enabled get set
Whether this Input Field component is Enabled
bool Interactable get set
Is the Input Field interactable?
bool IsFocused get
Does the InputField currently have focus and is able to process events.
float CaretBlinkRate get set
The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.
int CaretWidth get set
The width of the caret in pixels.
int CharacterLimit get set
Property Description
bool ReadOnly get set
Property Description
bool MultiLine get
If the input field supports multiple lines.
char AsteriskChar get set
The character used for password fields.
int CaretPosition get set
Current InputField caret position (also selection tail).
int SelectionAnchorPosition get set
The beginning point of the selection.
int SelectionFocusPosition get set
The end point of the selection.
float MinWidth get
The minimum width this UIInputField may be allocated. (Used by the Layout system).
float PreferredWidth get
The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleWidth get
The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
float MinHeight get
The minimum height this UIInputField may be allocated.(Used by the Layout system).
float PreferredHeight get
The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
float FlexibleHeight get
The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
SColor NormalColor get set
The normal color.
HighlightedColor get set
The color of the control when it is highlighted.
PressedColor get set
The color of the control when it is pressed.
DisabledColor get set
The color of the control when it is disabled.
float ColorMultiplier get set
This multiplies the tint color for each transition by its value.
GameObject get
Property Description
int get set
int get set
int get set
float get
float get
float get
float get
float get
float get
SColor get set
SColor get set
SColor get set
SColor get set
float get set
SGameObject get
void OnValueChanged (Closure callback)
void OnEndEdit (Closure callback)
void ActivateInputField ()
void DeactivateInputField ()
void Select ()
string Text get set
bool Enabled get set
bool Interactable get set
bool IsFocused get
float CaretBlinkRate get set
int CaretWidth get set
int CharacterLimit get set
bool ReadOnly get set
bool MultiLine get
char get set
function OVC()
--
end
Space.Host.ExecutingObject.UIInputField.OnValueChanged(OVC)--This script will make an input field update a text field
--with character count in real-time every time a character is typed/removed
--[Text field and Input fields need to be added as references (scripting runtime)]
thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText
OnValueChanged = function()
textField.Text = "Count= " .. string.len(inputField.Text)
end
thisObject.UIInputField.OnValueChanged(OnValueChanged)function OEE()
--
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OEE)--This script will make an input field update a text field
--as soon as someone has finished typing in it
--Text field and Input fields need to be added as references (scripting runtime)
thisObject = Space.Host.ExecutingObject
inputField = Space.Host.GetReference("The Input Field").UIInputField
textField = Space.Host.GetReference("The Text Field").UIText
OnEndEdit = function()
textField.Text = inputField.Text
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OnEndEdit)Space.Host.ExecutingObject.UIInputField.ActivateInputField()Space.Host.ExecutingObject.UIInputField.DeactivateInputField()Space.Host.ExecutingObject.UIInputField.DeactivateInputField()Space.Host.ExecutingObject.UIInputField.Text= "Hello"--the below script makes this object set Browser URL according to what's written in text field
--[Required: This object needs a Browser and InputField objects to be added as reference to references section in Scripting Runtime component]
thisGameObject = Space.Host.ExecutingObject
webBrowser = Space.Host.GetReference("Browser")
urlField = Space.Host.GetReference("URL Field")
OnClick = function()
webBrowser.Browser.SetURL = urlField.UIInputField.Text
end
urlField.UIInputField.Text = https://www.youtube.com
thisGameObject.AddClickable()
thisGameObject.Clickable.Tooltip = "Click to set URL"
thisGameObject.Clickable.OnClick(OnClick) Space.Host.ExecutingObject.UIInputField.Enabled= true--clicking this object will toggle a UIInputField's Enabled status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.Enabled = not inputfield.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)Space.Host.ExecutingObject.UIInputField.Interactable= true--clicking this object will toggle a UIInputField's interactable status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.Interactable = not inputfield.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused Space.Host.ExecutingObject.UIInputField.CaretBlinkRate= 3Space.Host.ExecutingObject.UIInputField.CaretWidth= 4Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8Is the InputField read only?--clicking this object will toggle a UIInputField's ReadOnly status
thisGameObject = Space.Host.ExecutingObject
inputfield = Space.Host.GetReference("inputfield").UIInputField
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
inputfield.ReadOnly = not inputfield.ReadOnly
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)Space.Host.ExecutingObject.UIInputField.MultiLine = trueSpace.Host.ExecutingObject.UIInputField.AsteriskChar= "%"Space.Host.ExecutingObject.UIInputField.CaretPosition= 3Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4minWidth = Space.Host.ExecutingObject.UIInputField.MinWidthprefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidthflexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidthminHeight = Space.Host.ExecutingObject.UIInputField.MinHeightprefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeightflexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeightSpace.Host.ExecutingObject.UIInputField.NormalColor = Color.RedSpace.Host.ExecutingObject.UIInputField.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIInputField.PressedColor = Color.RedSpace.Host.ExecutingObject.UIInputField.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.RedtheGameObject = Space.Host.ExecutingObject.UIInputField.GameObject