SliderWidget
Added v1.0.48
Widget from SliderWidget test.

The SliderWidget is a simple gui slider, like in the Minecraft option menus. It features Horizontal and Vertical modes, and can have any number of steps.
Features
- Orientation mode – Horizontal or Vertical modes.
- Event handling – Fires callbacks when the slider moves.
- Step Size - How many steps the slider has. 0 = the length of the slider, adding more than the length allows sub gui-pixel slider.
Properties
| Field | Type | Description |
|---|---|---|
sliderValue |
Float |
The position value of the slider, 0 - 1. |
valueStep |
Integer |
Number of steps the slider has. 0 = the length of the slider, adding more than the length allows sub gui-pixel slider. |
leftUpKey |
Char/Integer |
Integer representation of the key used to move the slider in the left or up direction, depending on mode. |
rightDownKey |
Char/Integer |
Same as above but for right and down |
handleSize |
Integer |
Size of handle in pixels. |
minAmount |
Float |
Min amount of slider, used for code only. |
minAmount |
Float |
Same as above but max. |
APIs
setSliderCallback
Setting the change callback.
Example sets text overlay to display value in percentage.
getAmount
Returns float of the lerp from minAmount to maxAmount.
Example, minAmount = 5, maxAmount = 10, sliderValue = 0.5f, then .getAmount() returns 0.75f
setAmount
Sets the sliderValue to the inverseLerp using minAmount and maxAmount
Example, minAmount = 5, maxAmount = 10, sliderValue = 0.5f, then .getAmount() returns 0.75f