ui Toggle

ui Toggle

useful to allow an ON/OFF, YES/NO type of widget. See sample project for examples of different features. To use widget, you can set uiToggleOn = true/false and you can retrieve the state by checking uiToggleOn (ex. true=yes, false=no).

Property

uiBarColor=c_green The color of ‘on-bar’.
uiBarColorBlend=c_lime The color used with uiBarColor for blending.
uiDrawSquare=false //rounded or rectangle, whether to draw a rounded or rectangle box for widget.
uiAniDraw=true //animate the movement….not jump to position, animate gauge movements between values, or jump/draw actual values instantly.
uiToggleOn=true/false //read or set value to determine the state of the toggle switch.
uiOnLabel=”YES” //Value of text to display when toggle is set true. you can set to blank.
uiOnLabelColor=c_yellow //color of ON label when toggle is true/ON.
uiOffLabel=”OFF” //value of text to display when toggle is set false. you can set to blank.
uiOffLabelColor=c_dkgray //color of OFF label when toggle is false/OFF.
uiOffAlpha=0.8; //when toggle is false/OFF it will draw with this alpha. (text and graphics)
uiSlideSprite = -1; //use a sprite instead of roundrectangle for slider. must have sprite set to center origin!
uiSliderColor = c_white; //if not using sprite then the colour of the slider rectangle.
uiSlideBarHeight= -1; //you can customize the height of the slider bar. useful if you want no text and a large sprite for slider (see example).

You may also like...