Skip to content

UI Radio Group

Mutually exclusive options.

Type: UIRadioGroupNode · Category: UI & Interface · Also found as: uiradiogroup

Property Type Default Description
size vec2 (360, 82) Width and height (px). Range 4 to 1280.
label string "Option" Caption shown next to the control.
labelWidth number 110 Width reserved for the label (px); 0 = none. Range 0 to 300.
selectedIndex integer 0 Index of the selected item (-1 = none). Range 0 to 16.
defaultIndex integer 0 Index restored by reset. Range 0 to 16.
horizontal boolean false Options in a row (else a column).

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

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

Returns any

UIRadioGroupNode:set_property(path, value, y)

Section titled “UIRadioGroupNode: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 UIRadioGroupNodeProperty|string
  • value any
  • y? number
{
"type": "UIRadioGroupNode",
"name": "UIRadioGroup",
"position": [
0,
0
],
"properties": {
"size": [
360,
82
],
"label": "Option",
"labelWidth": 110
}
}