Class: UIToggle

UIToggle(position, size, optionTexts, textSize) → {UIToggle}

new UIToggle(position, size, optionTexts, textSize) → {UIToggle}

A Toggle to be used for UIs
Parameters:
Name Type Description
position Array.<Array> Base position for the UIToggle
size Array.<Array> The size for the UIToggle
optionTexts Array.<String> The text for the different options
textSize float The size of the Text
Source:
Returns:
Type
UIToggle

Methods

configInterpolation(cycles, rate)

Configures the Interpolation
Parameters:
Name Type Description
cycles int Over how many frames should the Interpolation happen, 1 turns off Interpolation
rate float How much the Interpolation should change over a frame
Source:

draw(aCamera)

Draws the UIToggle to the given Camera
Parameters:
Name Type Description
aCamera Camera The Camera to draw the Toggle to
Source:

getCurValue() → {int}

Function to return which option is currently selected
Source:
Returns:
The index of the currently selected option
Type
int

setBGColor(c)

Sets the background's Color
Parameters:
Name Type Description
c Array.<float> The desired Color for the background
Source:

setNormalTextColor(c)

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

setSelectedTextColor(c)

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

setSelectionColor(c)

Sets the foreground's Color
Parameters:
Name Type Description
c Array.<float> The desired Color for the foreground indicating the selected option
Source:

update()

Updates the UIToggle
Source: