UI Toolbar
Row of icon buttons; raises item_clicked.
Type: UIToolbarNode · Category: UI & Interface · Also found as: uitoolbar
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
size |
vec2 | (600, 42) |
Width and height (px). Range 4 to 1280. |
activeToggleId |
integer | -1 |
Id of the pressed toggle button. |
buttonSize |
vec2 | (34, 32) |
Size of each button (px). |
spacing |
number | 4 |
Gap between items (px). Range 0 to 32. |
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.
UIToolbarNode:connect(event, handler)
Section titled “UIToolbarNode:connect(event, handler)”Connects a handler to one of this node’s events: item_clicked (A toolbar item was clicked); the tree events; custom ones.
self.node:connect("item_clicked", function(value, source) Log.info("item_clicked") end)eventUIToolbarNodeEvent|stringhandlerfun(value:any, source: UIToolbarNode)
Returns integer id Connection id for disconnect
UIToolbarNode:get_property(path)
Section titled “UIToolbarNode:get_property(path)”Reads an Inspector property by its path (vectors and colours as tables); “script.
local value = self.node:get_property("size")pathUIToolbarNodeProperty|string
Returns any
UIToolbarNode:set_property(path, value, y)
Section titled “UIToolbarNode: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)pathUIToolbarNodeProperty|stringvalueanyy?number
In a scene file
Section titled “In a scene file”{ "type": "UIToolbarNode", "name": "UIToolbar", "position": [ 0, 0 ], "properties": { "size": [ 600, 42 ], "activeToggleId": -1, "buttonSize": [ 34, 32 ] }}