LittleJS 1.28.0

UISystem

UISlider

UISlider - A UI object that acts as a slider or scrollbar

Extends UIObject

Constructor

new UISlider(pos, size, value, text, color, handleColor)uiSystem.js:1652

Create a UISlider object

pos Vector2 optional
size Vector2 optional
value number optional, default 0.5
text string optional
color Color optional, default uiSystem.defaultButtonColor
handleColor Color optional, default WHITE

Members

Methods

Inherited from UIObject

Members

fillMode : booleanuiSystem.js:1680

Should it fill up like a progress bar?

handleColor : ColoruiSystem.js:1674

Color for the handle part of the slider

handleSlice : TileSlice|undefineduiSystem.js:1678

Style to draw the handle, or the fill, with; undefined for the slider's own slice, or a rectangle when it has none

text : stringuiSystem.js:1684

The label shown on the slider

value : numberuiSystem.js:1672

Current percentage value of this slider 0-1

Methods

drawHandle(pos, size, color)uiSystem.js:1728

Draw the handle, or the fill of a fill mode slider, with the handle slice, the slider's own, or a rectangle

pos Vector2
size Vector2
color Color