Skip to content

UI Checkbox

Toggle checkbox widget for boolean options and feature flags.

Type: UICheckboxNode · Category: UI & Interface · Also found as: uicheckbox

Property Type Default Description
size vec2 (260, 26) Width and height (px). Range 4 to 1280.
label string "Checkbox" Caption shown next to the control.
checked boolean false Ticked now.
defaultChecked boolean false State restored by reset.
accentColor color #3b82f6ff Tick and fill colour.
boxSize number 14 Box size (px). Range 12 to 40.

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 UICheckboxNodeEvent|string
  • handler fun(value: any, source: UICheckboxNode)

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 UICheckboxNodeProperty|string

Returns any

UICheckboxNode:set_property(path, value, y)

Section titled “UICheckboxNode: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.” a field of the node’s script.

self.node:set_property("size", 100, 50)
  • path UICheckboxNodeProperty|string
  • value any
  • y? number
{
"type": "UICheckboxNode",
"name": "UICheckbox",
"position": [
0,
0
],
"properties": {
"size": [
260,
26
],
"label": "Checkbox",
"checked": false
}
}