SUIInputField
Index
Functions Index
| Function Name |
|---|
| void OnValueChanged (Closure callback) |
| void OnEndEdit (Closure callback) |
| void ActivateInputField () |
| void DeactivateInputField () |
| void Select () |
Properties Index
| Property Name |
|---|
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 AsteriskChar get set |
int CaretPosition get set |
int SelectionAnchorPosition get set |
int SelectionFocusPosition get set |
float MinWidth get |
float PreferredWidth get |
float FlexibleWidth get |
float MinHeight get |
float PreferredHeight get |
float FlexibleHeight get |
SColor NormalColor get set |
SColor HighlightedColor get set |
SColor PressedColor get set |
SColor DisabledColor get set |
float ColorMultiplier get set |
SGameObject GameObject get |
Functions
OnValueChanged
void OnValueChanged (Closure callback)
Given function will be called when text in Input Field has changed
| Parameter | Type | Description |
|---|---|---|
- Lua
function OVC()
--
end
Space.Host.ExecutingObject.UIInputField.OnValueChanged(OVC)
- Lua
--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)
OnEndEdit
void OnEndEdit (Closure callback)
Given function will be called when editing has ended
| Parameter | Type | Description |
|---|---|---|
- Lua
function OEE()
--
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(OEE)
- Lua
--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)
ActivateInputField
void ActivateInputField ()
Function Description
- Lua
Space.Host.ExecutingObject.UIInputField.ActivateInputField()
DeactivateInputField
void DeactivateInputField ()
Function Description
- Lua
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
Select
void Select ()
Function Description
- Lua
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
Properties
Text
string Text get set
The current value of the input field.
- Lua
Space.Host.ExecutingObject.UIInputField.Text= "Hello"
- Lua
--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)
Enabled
bool Enabled get set
Whether this Input Field component is Enabled
- Lua
Space.Host.ExecutingObject.UIInputField.Enabled= true
- Lua
--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)
Interactable
bool Interactable get set
Is the Input Field interactable?
- Lua
Space.Host.ExecutingObject.UIInputField.Interactable= true
- Lua
--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)
IsFocused
bool IsFocused get
Does the InputField currently have focus and is able to process events.
- Lua
hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused
CaretBlinkRate
float CaretBlinkRate get set
The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.
- Lua
Space.Host.ExecutingObject.UIInputField.CaretBlinkRate= 3
CaretWidth
int CaretWidth get set
The width of the caret in pixels.
- Lua
Space.Host.ExecutingObject.UIInputField.CaretWidth= 4
CharacterLimit
int CharacterLimit get set
Property Description
- Lua
Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8
ReadOnly
bool ReadOnly get set
Property Description
- Lua
Is the InputField read only?
- Lua
--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)
MultiLine
bool MultiLine get
If the input field supports multiple lines.
- Lua
Space.Host.ExecutingObject.UIInputField.MultiLine = true
AsteriskChar
char AsteriskChar get set
The character used for password fields.
- Lua
Space.Host.ExecutingObject.UIInputField.AsteriskChar= "%"
CaretPosition
int CaretPosition get set
Current InputField caret position (also selection tail).
- Lua
Space.Host.ExecutingObject.UIInputField.CaretPosition= 3
SelectionAnchorPosition
int SelectionAnchorPosition get set
The beginning point of the selection.
- Lua
Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1
SelectionFocusPosition
int SelectionFocusPosition get set
The end point of the selection.
- Lua
Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4
MinWidth
float MinWidth get
The minimum width this UIInputField may be allocated. (Used by the Layout system).
- Lua
minWidth = Space.Host.ExecutingObject.UIInputField.MinWidth
PreferredWidth
float PreferredWidth get
The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
- Lua
prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth
FlexibleWidth
float FlexibleWidth get
The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
- Lua
flexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidth
MinHeight
float MinHeight get
The minimum height this UIInputField may be allocated.(Used by the Layout system).
- Lua
minHeight = Space.Host.ExecutingObject.UIInputField.MinHeight
PreferredHeight
float PreferredHeight get
The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
- Lua
prefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeight
FlexibleHeight
float FlexibleHeight get
The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
- Lua
flexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeight
NormalColor
SColor NormalColor get set
The normal color.
- Lua
Space.Host.ExecutingObject.UIInputField.NormalColor = Color.Red
HighlightedColor
SColor HighlightedColor get set
The color of the control when it is highlighted.
- Lua
Space.Host.ExecutingObject.UIInputField.HighlightedColor = Color.Red
PressedColor
SColor PressedColor get set
The color of the control when it is pressed.
- Lua
Space.Host.ExecutingObject.UIInputField.PressedColor = Color.Red
DisabledColor
SColor DisabledColor get set
The color of the control when it is disabled.
- Lua
Space.Host.ExecutingObject.UIInputField.DisabledColor = Color.Red
ColorMultiplier
float ColorMultiplier get set
This multiplies the tint color for each transition by its value.
- Lua
Space.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.Red
GameObject
SGameObject GameObject get
Property Description
- Lua
``` theGameObject = Space.Host.ExecutingObject.UIInputField.GameObject ```