void OnValueChanged (Closure callback)
Binds a function to be triggered when value of the UIToggle changes.
bool Enabled get set
Whether the UIToggle is Enabled
bool Interactable get set
Whether the UIToggle is Interactable
bool IsOn get set
Whether the UIToggle is toggled On
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
void OnValueChanged (Closure callback)
bool Enabled get set
bool Interactable get set
bool IsOn get set
SColor NormalColor get set
SColor HighlightedColor get set
SColor PressedColor get set
SColor DisabledColor get set
float ColorMultiplier get set
SGameObject GameObject get
function ovc()
--
end
Space.Host.ExecutingObject.UIToggle.OnValueChanged(ovc)--This script will make a UI Toggle show/hide the Notification Button
--[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)Space.Host.ExecutingObject.UIToggle.Enabled = true--clicking this object will toggle a Toggles's Enabled status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Enabled = not toggle.Enabled
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)Space.Host.ExecutingObject.UIToggle.Interactable = true--clicking this object will toggle a Toggles's Interactable status
thisGameObject = Space.Host.ExecutingObject
toggle = Space.Host.GetReference("toggle").UIToggle
--make sure to add this reference to the Scripting Runtime component
OnClick = function()
toggle.Interactable= not toggle.Interactable
end
thisGameObject.AddClickable()
thisGameObject.Clickable.OnClick(OnClick)Space.Host.ExecutingObject.UIToggle.IsOn = true--This script will make a UI Toggle show/hide the Notification Button
--[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)Space.Host.ExecutingObject.UIToggle.NormalColor = Color.RedSpace.Host.ExecutingObject.UIToggle.HighlightedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.PressedColor = Color.RedSpace.Host.ExecutingObject.UIToggle.DisabledColor = Color.RedSpace.Host.ExecutingObject.UIToggle.ColorMultiplier = 1.2theGameObject = Space.Host.ExecutingObject.UIToggle.GameObject