Skip to content

UI Knob

Rotary value control.

Type: UIKnobNode · Category: UI & Interface · Also found as: uiknob

Property Type Default Description
size vec2 (64, 80) Width and height (px). Range 4 to 1280.
label string "Volume" Caption shown next to the control.
value number 50 Current value (between min and max). Range 0 to 100.
minValue number 0 Lowest value. Range 0 to 100.
maxValue number 100 Highest value. Range 1 to 1000.
defaultValue number 50 Value restored by reset (double-click).

Plus the common properties every node has.

Call them on the node (self.node in its script, or self.node:get_node("path")). Every node also has the Node methods.

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)
  • event UIKnobNodeEvent|string
  • handler fun(value: any, source: UIKnobNode)

Returns integer id Connection id for disconnect

Reads an Inspector property by its path (vectors and colours as tables); “script.” reads a field of the node’s script.

local value = self.node:get_property("size")
  • path UIKnobNodeProperty|string

Returns any

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.” a field of the node’s script.

self.node:set_property("size", 100, 50)
  • path UIKnobNodeProperty|string
  • value any
  • y? number
{
"type": "UIKnobNode",
"name": "UIKnob",
"position": [
0,
0
],
"properties": {
"size": [
64,
80
],
"label": "Volume",
"value": 50
}
}