Line 28: | Line 28: | ||
{{ScriptFunction|bool|Interactable|{ get;set; }|Whether the UIToggle is Interactable or not|5= <pre>Space.Host.ExecutingObject.UIToggle.Interactable = true</pre>}} | {{ScriptFunction|bool|Interactable|{ get;set; }|Whether the UIToggle is Interactable or not|5= <pre>Space.Host.ExecutingObject.UIToggle.Interactable = true</pre>}} | ||
− | {{ScriptFunction|bool|IsOn|{ get;set; }|Whether the UIToggle is toggled On or Off|5= <pre>Space.Host.ExecutingObject.UIToggle.IsOn = true</pre>}} | + | {{ScriptFunction|bool|IsOn|{ get;set; }|Whether the UIToggle is toggled On or Off|5= <pre>Space.Host.ExecutingObject.UIToggle.IsOn = true</pre>|6=<pre>--This script will make a UI Toggle show/hide the Notification Button |
+ | --(example: tools for user to customize UI) | ||
+ | --[You need to add an object with UI Toggle as a reference (scripting runtime)] | ||
+ | |||
+ | toggle = Space.Host.GetReference("Toggle").UIToggle | ||
+ | |||
+ | |||
+ | OnValueChanged = function() | ||
+ | if toggle.IsOn then | ||
+ | Space.UI.ShowNotificationButton= true | ||
+ | else | ||
+ | Space.UI.ShowNotificationButton= false | ||
+ | end | ||
+ | end | ||
+ | |||
+ | toggle.OnValueChanged(OnValueChanged)</pre>}} | ||
{{ScriptFunction|SColor|NormalColor|{get;set}|The normal color.|5= | {{ScriptFunction|SColor|NormalColor|{get;set}|The normal color.|5= |
Binds a function to be triggered when value of the UIToggle changes
ovc = function() Space.Log("Toggled") end Space.Host.ExecutingObject.UIToggle.OnValueChanged(ovc)
--This script will make a UI Toggle show/hide the Notification Button --(example: tools for user to customize UI) --[You need to add an object with UI Toggle as a reference (scripting runtime)] toggle = Space.Host.GetReference("Toggle").UIToggle OnValueChanged = function() if toggle.IsOn then Space.UI.ShowNotificationButton= true else Space.UI.ShowNotificationButton= false end end toggle.OnValueChanged(OnValueChanged)
Whether the UIToggle is Enabled or not
Space.Host.ExecutingObject.UIToggle.Enabled = true
Whether the UIToggle is Interactable or not
Space.Host.ExecutingObject.UIToggle.Interactable = true
Whether the UIToggle is toggled On or Off
Space.Host.ExecutingObject.UIToggle.IsOn = true
--This script will make a UI Toggle show/hide the Notification Button --(example: tools for user to customize UI) --[You need to add an object with UI Toggle as a reference (scripting runtime)] toggle = Space.Host.GetReference("Toggle").UIToggle OnValueChanged = function() if toggle.IsOn then Space.UI.ShowNotificationButton= true else Space.UI.ShowNotificationButton= false end end toggle.OnValueChanged(OnValueChanged)
The normal color.
The color of the control when it is highlighted.
The color of the control when it is pressed.
The color of the control when it is disabled.
This multiplies the tint color for each transition by its value.
|