wiki.sine.space | sinespace

Difference between revisions of "Scripting/SUIInputField"

From wiki.sine.space
Jump to: navigation, search
m
Line 52: Line 52:
 
{{ScriptFunction|bool|PreferredWidth|{ get; }|The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)|5= <pre>prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth</pre>}}
 
{{ScriptFunction|bool|PreferredWidth|{ get; }|The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)|5= <pre>prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth</pre>}}
  
 +
 +
{{ScriptFunction|SColor|NormalColor|{get;set}|The normal color.|5=
 +
local inputField=Space.Host.GetReference("InputField").UIInputField<br>
 +
Space.Log(inputField.NormalColor.ToString())
 +
}}
 +
 +
{{ScriptFunction|SColor|HighlightedColor|{get;set}|The color of the control when it is highlighted.|5=
 +
local inputField=Space.Host.GetReference("InputField").UIInputField<br>
 +
Space.Log(inputField.HighlightedColor.ToString())
 +
}}
 +
 +
{{ScriptFunction|SColor|PressedColor|{get;set}|The color of the control when it is pressed.|5=
 +
local inputField=Space.Host.GetReference("InputField").UIInputField<br>
 +
Space.Log(inputField.PressedColor.ToString())
 +
}}
 +
 +
{{ScriptFunction|SColor|DisabledColor|{get;set}|The color of the control when it is disabled.|5=
 +
local inputField=Space.Host.GetReference("InputField").UIInputField<br>
 +
Space.Log(inputField.DisabledColor.ToString())
 +
}}
 +
 +
{{ScriptFunction|float|ColorMultiplier|{get;set}|This multiplies the tint color for each transition by its value.|5=
 +
local inputField=Space.Host.GetReference("InputField").UIInputField<br>
 +
Space.Log(inputField.ColorMultiplier)
 +
}}
  
  
 
{{Scripting Navbox}}
 
{{Scripting Navbox}}

Revision as of 07:00, 31 December 2020

Members

OnEndEdit

void OnEndEdit (closure callback)

Given function will be called when editing has ended

oee = function()
  Space.Log("edit ended")
end
Space.Host.ExecutingObject.UIInputField.OnEndEdit(oee)


OnValueChanged

void OnValueChanged (closure callback)

Given function will be called when text in Input Field has changed

ovc = function()
  Space.Log("value changed")
  end
Space.Host.ExecutingObject.UIInputField.OnValueChanged(ovc)



Properties

AsteriskChar

char AsteriskChar { get; set; }

The character used for password fields.

Space.Host.ExecutingObject.UIInputField.AsteriskChar= "%"


CaretBlinkRate

float CaretBlinkRate { get; set; }

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


CaretPosition

int CaretPosition { get; set; }

Current InputField caret position (also selection tail).

Space.Host.ExecutingObject.UIInputField.CaretPosition= 3


CaretWidth

int CaretWidth { get; set; }

The width of the caret in pixels.

Space.Host.ExecutingObject.UIInputField.CaretWidth= 4


CharacterLimit

int CharacterLimit { get; set; }

No documentation

Space.Host.ExecutingObject.UIInputField.CharacterLimit= 8


Enabled

bool Enabled { get; set; }

Whether this Input Field component is Enabled or not

Space.Host.ExecutingObject.UIInputField.Enabled= true


Interactable

bool Interactable { get; set; }

Is the Input Field interactable?

Space.Host.ExecutingObject.UIInputField.Interactable= true


IsFocused

bool IsFocused { get;}

Does the InputField currently have focus and is able to process events.

hasFocus = Space.Host.ExecutingObject.UIInputField.IsFocused 


ReadOnly

bool ReadOnly { get;set; }

Set the InputField to be read only.

Space.Host.ExecutingObject.UIInputField.ReadOnly= true


SelectionAnchorPosition

int SelectionAnchorPosition { get;set;}

The beginning point of the selection.

Space.Host.ExecutingObject.UIInputField.SelectionAnchorPosition= 1


SelectionFocusPosition

int SelectionFocusPosition { get;set; }

The end point of the selection.

Space.Host.ExecutingObject.UIInputField.SelectionFocusPosition= 4


Text

string Text { get;set; }

The current value of the input field.

Space.Host.ExecutingObject.UIInputField.Text= "Hello"


FlexibleHeight

float FlexibleHeight { get;}

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


FlexibleWidth

float FlexibleWidth { get;}

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

float MinHeight { get;}

The minimum height this UIInputField may be allocated.(Used by the Layout system).

minHeight = Space.Host.ExecutingObject.UIInputField.MinHeight


MinWidth

float MinWidth { get;}

The minimum width this UIInputField may be allocated. (Used by the Layout system).

minWidth = Space.Host.ExecutingObject.UIInputField.MinWidth


MultiLine

bool MultiLine { get;}

If the input field supports multiple lines.

Space.Host.ExecutingObject.UIInputField.MultiLine = true


PreferredHeight

float PreferredHeight { get;}

The preferred height this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)

prefHeight = Space.Host.ExecutingObject.UIInputField.PreferredHeight


PreferredWidth

bool PreferredWidth { get; }

The preferred width this UIInputField should be allocated if there is sufficient space. (Used by the Layout system)

prefWidth = Space.Host.ExecutingObject.UIInputField.PreferredWidth



NormalColor

SColor NormalColor {get;set}

The normal color.

local inputField=Space.Host.GetReference("InputField").UIInputField
Space.Log(inputField.NormalColor.ToString())


HighlightedColor

SColor HighlightedColor {get;set}

The color of the control when it is highlighted.

local inputField=Space.Host.GetReference("InputField").UIInputField
Space.Log(inputField.HighlightedColor.ToString())


PressedColor

SColor PressedColor {get;set}

The color of the control when it is pressed.

local inputField=Space.Host.GetReference("InputField").UIInputField
Space.Log(inputField.PressedColor.ToString())


DisabledColor

SColor DisabledColor {get;set}

The color of the control when it is disabled.

local inputField=Space.Host.GetReference("InputField").UIInputField
Space.Log(inputField.DisabledColor.ToString())


ColorMultiplier

float ColorMultiplier {get;set}

This multiplies the tint color for each transition by its value.

local inputField=Space.Host.GetReference("InputField").UIInputField
Space.Log(inputField.ColorMultiplier)