wiki.sine.space | sinespace

Difference between revisions of "Scripting/SUISlider"

From wiki.sine.space
Jump to: navigation, search
(Added and defined all members (14) of SUISlider)
 
(Added simple examples to SUISlider .WholeNumbers . Value .NormalizedValue .MinValue .MaxValue .Interactable .Enabled . Direction .OnValueChanged)
Line 1: Line 1:
 
==Members==
 
==Members==
{{ScriptFunction|void|OnValueChanged|(Closure callback);|Callback executed when the value of the slider is changed.|5=<pre></pre>}}
+
{{ScriptFunction|void|OnValueChanged|(Closure callback);|Callback executed when the value of the slider is changed.|5=<pre>function valueChanged()
 +
 
 +
  Space.Log("value changed")
 +
 
 +
  end
 +
 
 +
Space.Host.ExecutingObject.UISlider.OnValueChanged(valueChanged)</pre>}}
  
  
 
==Properties==
 
==Properties==
 
{{ScriptFunction|float|ColorMultiplier|{ get;set; }|Multiplier applied to colors (allows brightening greater then base color).|5=<pre></pre>}}
 
{{ScriptFunction|float|ColorMultiplier|{ get;set; }|Multiplier applied to colors (allows brightening greater then base color).|5=<pre></pre>}}
{{ScriptFunction|Slider.Direction|Direction|{ get;set; }|The direction of the slider, from minimum to maximum value.|5=<pre></pre>}}
+
{{ScriptFunction|Slider.Direction|Direction|{ get;set; }|The direction of the slider (0 to 4).
 +
0 Left To Right, 1 Right To Left, 2 Bottom To Top, 3 Top To Bottom|5=<pre>Space.Host.ExecutingObject.UISlider.Direction = 1</pre>}}
 
{{ScriptFunction|SColor|DisabledColor|{ get;set; }|Disabled Color.|5=<pre></pre>}}
 
{{ScriptFunction|SColor|DisabledColor|{ get;set; }|Disabled Color.|5=<pre></pre>}}
{{ScriptFunction|bool|Enabled|{ get;set; }|Whether this is visually updating or not|5=<pre></pre>}}
+
{{ScriptFunction|bool|Enabled|{ get;set; }|Whether this slider is Enabled or not|5=<pre>Space.Host.ExecutingObject.UISlider.Enabled = false  --or false</pre>}}
 
{{ScriptFunction|SColor|HighlightedColor|{ get;set; }|Highlighted Color.|5=<pre></pre>}}
 
{{ScriptFunction|SColor|HighlightedColor|{ get;set; }|Highlighted Color.|5=<pre></pre>}}
{{ScriptFunction|bool|Interactable|{ get;set;}|Use to enable or disable the ability to interact with the slider.|5=<pre></pre>}}
+
{{ScriptFunction|bool|Interactable|{ get;set;}|Use to enable or disable the ability to interact with the slider.|5=<pre>Space.Host.ExecutingObject.UISlider.Interactable = true</pre>}}
{{ScriptFunction|float|MaxValue|{ get;set; }|The maximum allowed value of the slider.|5=<pre></pre>}}
+
{{ScriptFunction|float|MaxValue|{ get;set; }|The maximum allowed value of the slider.|5=<pre>Space.Host.ExecutingObject.UISlider.MaxValue = 20</pre>}}
{{ScriptFunction|float|MinValue|{ get;set; }|The minimum allowed value of the slider.|5=<pre></pre>}}
+
{{ScriptFunction|float|MinValue|{ get;set; }|The minimum allowed value of the slider.|5=<pre>Space.Host.ExecutingObject.UISlider.MinValue = 10</pre>}}
 
{{ScriptFunction|SColor|NormalColor|{ get;set; }|Normal Color.|5=<pre></pre>}}
 
{{ScriptFunction|SColor|NormalColor|{ get;set; }|Normal Color.|5=<pre></pre>}}
{{ScriptFunction|float|NormalizedValue|{ get;set; }|The current value of the slider normalized into a value between 0 and 1.|5=<pre></pre>}}
+
{{ScriptFunction|float|NormalizedValue|{ get;set; }|The current value of the slider normalized into a value between 0 and 1.|5=<pre>Space.Log(Space.Host.ExecutingObject.UISlider.NormalizedValue)
 +
--displays the current normalized value of the slider in the console</pre>}}
 
{{ScriptFunction|SColor|PressedColor|{ get;set; }|Pressed Color.|5=<pre></pre>}}
 
{{ScriptFunction|SColor|PressedColor|{ get;set; }|Pressed Color.|5=<pre></pre>}}
{{ScriptFunction|float|Value|{ get;set; }|The current value of the slider.|5=<pre></pre>}}
+
{{ScriptFunction|float|Value|{ get;set; }|The current value of the slider.|5=<pre>Space.Log(Space.Host.ExecutingObject.UISlider.Value)
{{ScriptFunction|bool|WholeNumbers|{ get;set; }|Should the value only be allowed to be whole numbers?|5=<pre></pre>}}
+
--displays the current value of the slider in the console</pre>}}
 +
{{ScriptFunction|bool|WholeNumbers|{ get;set; }|Should the value only be allowed to be whole numbers?|5=<pre>Space.Host.ExecutingObject.UISlider.WholeNumbers = true --or false</pre>}}

Revision as of 15:23, 18 December 2020

Members

OnValueChanged

void OnValueChanged (Closure callback);

Callback executed when the value of the slider is changed.

function valueChanged()
  
  Space.Log("value changed")
  
  end

Space.Host.ExecutingObject.UISlider.OnValueChanged(valueChanged)



Properties

ColorMultiplier

float ColorMultiplier { get;set; }

Multiplier applied to colors (allows brightening greater then base color).


Direction

Slider.Direction Direction { get;set; }

The direction of the slider (0 to 4). 0 Left To Right, 1 Right To Left, 2 Bottom To Top, 3 Top To Bottom

Space.Host.ExecutingObject.UISlider.Direction = 1


DisabledColor

SColor DisabledColor { get;set; }

Disabled Color.


Enabled

bool Enabled { get;set; }

Whether this slider is Enabled or not

Space.Host.ExecutingObject.UISlider.Enabled = false  --or false


HighlightedColor

SColor HighlightedColor { get;set; }

Highlighted Color.


Interactable

bool Interactable { get;set;}

Use to enable or disable the ability to interact with the slider.

Space.Host.ExecutingObject.UISlider.Interactable = true


MaxValue

float MaxValue { get;set; }

The maximum allowed value of the slider.

Space.Host.ExecutingObject.UISlider.MaxValue = 20


MinValue

float MinValue { get;set; }

The minimum allowed value of the slider.

Space.Host.ExecutingObject.UISlider.MinValue = 10


NormalColor

SColor NormalColor { get;set; }

Normal Color.


NormalizedValue

float NormalizedValue { get;set; }

The current value of the slider normalized into a value between 0 and 1.

Space.Log(Space.Host.ExecutingObject.UISlider.NormalizedValue)
--displays the current normalized value of the slider in the console


PressedColor

SColor PressedColor { get;set; }

Pressed Color.


Value

float Value { get;set; }

The current value of the slider.

Space.Log(Space.Host.ExecutingObject.UISlider.Value)
--displays the current value of the slider in the console


WholeNumbers

bool WholeNumbers { get;set; }

Should the value only be allowed to be whole numbers?

Space.Host.ExecutingObject.UISlider.WholeNumbers = true --or false