UI Notched Slider
Slider that snaps to detents.
Type: UINotchedSliderNode · Category: UI & Interface · Also found as: uinotchedslider
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
size |
vec2 | (360, 48) |
Width and height (px). Range 4 to 1280. |
label |
string | "Detents" |
Caption shown next to the control. |
value |
number | 0 |
Current value. |
minValue |
number | 0 |
Lowest value. |
maxValue |
number | 4 |
Highest value. |
numNotches |
integer | 5 |
Number of notch marks. Range 2 to 32. |
snapToNotches |
boolean | true |
Snap the value to the notches. |
orientation |
enum: Horizontal, Vertical |
Horizontal |
Horizontal or vertical. |
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.
UINotchedSliderNode:connect(event, handler)
Section titled “UINotchedSliderNode: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)eventUINotchedSliderNodeEvent|stringhandlerfun(value:any, source: UINotchedSliderNode)
Returns integer id Connection id for disconnect
UINotchedSliderNode:get_property(path)
Section titled “UINotchedSliderNode:get_property(path)”Reads an Inspector property by its path (vectors and colours as tables); “script.
local value = self.node:get_property("size")pathUINotchedSliderNodeProperty|string
Returns any
UINotchedSliderNode:set_property(path, value, y)
Section titled “UINotchedSliderNode: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)pathUINotchedSliderNodeProperty|stringvalueanyy?number
In a scene file
Section titled “In a scene file”{ "type": "UINotchedSliderNode", "name": "UINotchedSlider", "position": [ 0, 0 ], "properties": { "size": [ 360, 48 ], "label": "Detents", "value": 0 }}