UI Icon
Vector icon.
Type: UIIconNode · Category: UI & Interface · Also found as: uiicon
Properties
Section titled “Properties”| Property | Type | Default | Description |
|---|---|---|---|
size |
vec2 | (28, 28) |
Width and height (px). Range 4 to 1280. |
icon |
enum: None, Digit0, Digit1, Digit2, Digit3, Digit4, Digit5, Digit6, Digit7, Digit8, Digit9, A … |
None |
Icon shown (Font Awesome). |
iconSize |
number | 0 |
Icon size (px). Range 8 to 128. |
color |
color | #eef0f6ff |
Icon colour. |
align |
enum: Left, Center, Right |
Center |
Horizontal text alignment. |
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.
UIIconNode:get_property(path)
Section titled “UIIconNode:get_property(path)”Reads an Inspector property by its path (vectors and colours as tables); “script.
local value = self.node:get_property("size")pathUIIconNodeProperty|string
Returns any
UIIconNode:set_property(path, value, y)
Section titled “UIIconNode: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)pathUIIconNodeProperty|stringvalueanyy?number
In a scene file
Section titled “In a scene file”{ "type": "UIIconNode", "name": "UIIcon", "position": [ 0, 0 ], "properties": { "size": [ 28, 28 ], "icon": "None", "iconSize": 0 }}