UI Slider
Draggable continuous value slider for settings, volume, and numeric input.
Type: UISliderNode · Category: UI & Interface · Also found as: uislider
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
size |
vec2 | (360, 28) |
Width and height (px). Range 4 to 1280. |
label |
string | "Value" |
Caption shown next to the control. |
value |
number | 0.5 |
Current value (between min and max). Range -1000 to 1000. |
minValue |
number | 0 |
Lowest value. Range -10000 to 10000. |
maxValue |
number | 1 |
Highest value. Range -10000 to 10000. |
defaultValue |
number | 0.5 |
Value restored by reset (double-click). Range -10000 to 10000. |
fineScale |
number | 0.1 |
Drag speed with Shift held (fine adjustment). Range 0.01 to 0.5. |
isInteger |
boolean | false |
Snap to whole numbers. |
showResetButton |
boolean | true |
Show a button that restores the default value. |
labelWidth |
number | 110 |
Width reserved for the label (px); 0 = none. Range 0 to 300. |
Plus the common properties every node has.
Lua methods
Section titled “Lua methods”Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.
UISliderNode:connect(event, handler)
Section titled “UISliderNode:connect(event, handler)”Connects a handler to one of this node’s events: value_changed (The value changed); the tree events; custom ones.
self.node:connect("value_changed", function(value, source) Log.info("value_changed") end)eventUISliderNodeEvent|stringhandlerfun(value:any, source: UISliderNode)
Returns integer id Connection id for disconnect
UISliderNode:get_property(path)
Section titled “UISliderNode:get_property(path)”Reads an Inspector property by its path (vectors and colours as tables); “script.
local value = self.node:get_property("size")pathUISliderNodeProperty|string
Returns any
UISliderNode:set_property(path, value, y)
Section titled “UISliderNode:set_property(path, value, y)”Sets an Inspector property by its path: vectors as {x, y} or x, y; colours as {r, g, b[, a]} 0..1 or “#rrggbb[aa]”; enums by name; “script.
self.node:set_property("size", 100, 50)pathUISliderNodeProperty|stringvalueanyy?number
In a scene file
Section titled “In a scene file”{ "type": "UISliderNode", "name": "UISlider", "position": [ 0, 0 ], "properties": { "size": [ 360, 28 ], "label": "Value", "value": 0.5 }}