Dropdown
A closed list that opens on press — a resolution or language picker — and draws its options in a popup over everything else, flipped and clamped so it never runs off the bottom of the screen. Goes under a Canvas.
On this page
Add it
+ Add node → Dropdown creates a node with it already on. Already have a node for it? Add component → DropdownComponent.
From a script
A script on the same node writes these fields by name. DropdownComponent is the name to pass.
rgs
set_text("DropdownComponent", "action", "");
set_flag("DropdownComponent", "disabled", false);
set_number("DropdownComponent", "item_height", 32.0);
set_colour("DropdownComponent", "normal", vec4(0.2, 0.2, 0.24, 1.0));
set_colour("DropdownComponent", "hovered", vec4(0.3, 0.3, 0.36, 1.0));
set_colour("DropdownComponent", "pressed", vec4(0.12, 0.12, 0.15, 1.0));
set_colour("DropdownComponent", "popup", vec4(0.1, 0.1, 0.13, 1.0)); Fields
| Field | Script name | Kind | Default | What it does |
|---|---|---|---|---|
| Action | action | text | empty | Reported when the selection changes. |
| Options | options | list | 1 entries | The options, in order. |
| Selected | selected | number, at least 0 | 0 | Which one is chosen. Out of range reads as nothing chosen. |
| Disabled | disabled | checkbox | off | Whether it accepts input. |
| Item Height | item_height | number, at least 1 | 32 | Height of one row of the open list, in UI units. |
| Normal | normal | colour | #33333d | Tint when idle. |
| Hovered | hovered | colour | #4d4d5c | Tint under the pointer, or when focused. |
| Pressed | pressed | colour | #1f1f26 | Tint while held, and while the list is open. |
| Popup | popup | colour | #1a1a21 | Background of the open list. |