SUIInputField
في هذا الصنفOnValueChanged
- الدوال
- On
Value Changed - On
End Edit - Activate
Input Field - Deactivate
Input Field - Select
- الخصائص
- Text
- Enabled
- Interactable
- Is
Focused - Caret
Blink Rate - Caret
Width - Character
Limit - Read
Only - Multi
Line - Asterisk
Char - Caret
Position - Selection
Anchor Position - Selection
Focus Position - Min
Width - Preferred
Width - Flexible
Width - Min
Height - Preferred
Height - Flexible
Height - Normal
Color - Highlighted
Color - Pressed
Color - Disabled
Color - Color
Multiplier - Game
Object
| دالة | OnValueChanged | Given function will be called when text in Input Field has changed |
| دالة | OnEndEdit | Given function will be called when editing has ended |
| دالة | ActivateInputField | – |
| دالة | DeactivateInputField | – |
| دالة | Select | – |
| خاصية | Text | The current value of the input field. |
| خاصية | Enabled | Whether this Input Field component is Enabled |
| خاصية | Interactable | Is the Input Field interactable? |
| خاصية | IsFocused | Does the InputField currently have focus and is able to process events. |
| خاصية | CaretBlinkRate | The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second. |
| خاصية | CaretWidth | The width of the caret in pixels. |
| خاصية | CharacterLimit | – |
| خاصية | ReadOnly | – |
| خاصية | MultiLine | If the input field supports multiple lines. |
| خاصية | AsteriskChar | The character used for password fields. |
| خاصية | CaretPosition | Current InputField caret position (also selection tail). |
| خاصية | SelectionAnchorPosition | The beginning point of the selection. |
| خاصية | SelectionFocusPosition | The end point of the selection. |
| خاصية | MinWidth | The minimum width this UIInputField may be allocated. (Used by the Layout system). |
| خاصية | PreferredWidth | The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system) |
| خاصية | FlexibleWidth | The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system) |
| خاصية | MinHeight | The minimum height this UIInputField may be allocated.(Used by the Layout system). |
| خاصية | PreferredHeight | The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system) |
| خاصية | FlexibleHeight | The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system) |
| خاصية | NormalColor | The normal color. |
| خاصية | HighlightedColor | The color of the control when it is highlighted. |
| خاصية | PressedColor | The color of the control when it is pressed. |
| خاصية | DisabledColor | The color of the control when it is disabled. |
| خاصية | ColorMultiplier | This multiplies the tint color for each transition by its value. |
| خاصية | GameObject | – |
الدوال
OnValueChanged
Given function will be called when text in Input Field has changed
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| callback | Closure | – |
القيم المرجعة
void
مثال
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)
OnEndEdit
Given function will be called when editing has ended
المعاملات
| الاسم | النوع | القيمة الافتراضية |
|---|---|---|
| callback | Closure | – |
القيم المرجعة
void
مثال
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)
ActivateInputField
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.UIInputField.ActivateInputField()
DeactivateInputField
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
Select
القيم المرجعة
void
مثال
Space.Host.ExecutingObject.UIInputField.DeactivateInputField()
الخصائص
Text
The current value of the input field.
مثال
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)
Enabled
Whether this Input Field component is Enabled
مثال
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)
Interactable
Is the Input Field interactable?
مثال
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)
IsFocusedللقراءة فقط
Does the InputField currently have focus and is able to process events.
مثال
hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused
CaretBlinkRate
The blinking rate of the input caret, defined as the number of times the blink cycle occurs per second.
مثال
Space.Host.ExecutingObject.UIInputField.CaretBlinkRate= 3
CaretWidth
The width of the caret in pixels.
مثال
Space.Host.ExecutingObject.UIInputField.CaretWidth= 4
CharacterLimit
مثال
Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8
ReadOnly
مثال
Is 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)
MultiLineللقراءة فقط
If the input field supports multiple lines.
مثال
Space.Host.ExecutingObject.UIInputField.MultiLine = true
AsteriskChar
The character used for password fields.
مثال
Space.Host.ExecutingObject.UIInputField.AsteriskChar= "%"
CaretPosition
Current InputField caret position (also selection tail).
مثال
Space.Host.ExecutingObject.UIInputField.CaretPosition= 3
SelectionAnchorPosition
The beginning point of the selection.
مثال
Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1
SelectionFocusPosition
The end point of the selection.
مثال
Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4
MinWidthللقراءة فقط
The minimum width this UIInputField may be allocated. (Used by the Layout system).
مثال
minWidth = Space.Host.ExecutingObject.UIInputField.MinWidth
PreferredWidthللقراءة فقط
The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
مثال
prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth
FlexibleWidthللقراءة فقط
The extra relative width this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
مثال
flexWidth = Space.Host.ExecutingObject.UIInputField.FlexibleWidth
MinHeightللقراءة فقط
The minimum height this UIInputField may be allocated.(Used by the Layout system).
مثال
minHeight = Space.Host.ExecutingObject.UIInputField.MinHeight
PreferredHeightللقراءة فقط
The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)
مثال
prefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeight
FlexibleHeightللقراءة فقط
The extra relative height this UIInputField should be allocated if there is additional available space. (Used by the Layout system)
مثال
flexHeight = Space.Host.ExecutingObject.UIInputField.FlexibleHeight
NormalColor
The normal color.
مثال
Space.Host.ExecutingObject.UIInputField.NormalColor = Color.Red
HighlightedColor
The color of the control when it is highlighted.
مثال
Space.Host.ExecutingObject.UIInputField.HighlightedColor = Color.Red
PressedColor
The color of the control when it is pressed.
مثال
Space.Host.ExecutingObject.UIInputField.PressedColor = Color.Red
DisabledColor
The color of the control when it is disabled.
مثال
Space.Host.ExecutingObject.UIInputField.DisabledColor = Color.Red
ColorMultiplier
This multiplies the tint color for each transition by its value.
مثال
Space.Host.ExecutingObject.UIInputField.ColorMultiplier = Color.Red
GameObjectللقراءة فقط
مثال
``` theGameObject = Space.Host.ExecutingObject.UIInputField.GameObject ```



