Class: UISlider

UISlider(position, size) → {UISlider}

new UISlider(position, size) → {UISlider}

A Slider to be used for UIs
Parameters:
Name Type Description
position Array.<Array> Base position for the UISlider
size Array.<Array> The size for the UISlider
Source:
Returns:
Type
UISlider

Methods

_checkPosOnBar(pos) → {float}

Private function to return valid position on Slider if given position is not on Slider's Bar
Parameters:
Name Type Description
pos float Position to check
Source:
Returns:
Valid position on Slider
Type
float

draw(aCamera)

Draws the UISlider
Parameters:
Name Type Description
aCamera Camera The camera to draw it on
Source:

setColor(c)

Sets the Color of the Slider's Bar
Parameters:
Name Type Description
c Array.<float> The Color to be used for the Bar
Source:

setCurrentValue(v)

Sets the current value of the Slider
Parameters:
Name Type Description
v float The value the Slider should be at
Source:

setHandleColor(c)

Sets the Color of the Handle
Parameters:
Name Type Description
c Array.<float> The Color to be used for the Handle
Source:

setHandleSize(w, h)

Sets the size of the Handle
Parameters:
Name Type Description
w float Desired width for the Handle
h float Desired height for the Handle
Source:

setHandleTexture(tex)

Sets the Texture of the Handle
Parameters:
Name Type Description
tex String Location of the Texture to be used for the Handle
Source:

setMultiplier(v)

Sets the value of the multiplier
Parameters:
Name Type Description
v float The number the current value should be multiplied by when shown
Source:

setSnap(b)

Sets whtether the Slider should snap
Parameters:
Name Type Description
b bool Should the Slider snap to certain values
Source:

setSnapBy(v)

Sets increments for Slider to snap by
Parameters:
Name Type Description
v float The increments by which the Slider should snap by (eg. if set to 0.5, Slider will snap to nearest 0.5 so 1.2 would snap to 1 and 1.7 would snap to 1.5)
Source:

setTextColor(c)

Sets the Color of the Text
Parameters:
Name Type Description
c Array.<float> The desired Color of the Text
Source:

setTextSize(val)

Sets the size of the Text
Parameters:
Name Type Description
val float The desired of the Text
Source:

setTextVisible(b)

Sets whether the Text should be visible
Parameters:
Name Type Description
b bool Should the Text be shown
Source:

setTextXOffset(v)

Sets the X offset of the Text from position of Slider
Parameters:
Name Type Description
v float The value to offset the Text by
Source:

setToFixedValue(v)

Sets the amount of decimal places should be shown by the Text element
Parameters:
Name Type Description
v float The amount of decimal places to be shown
Source:

update()

Update the UISlider
Source: