Skip to content

Components

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

FieldScript nameKindDefaultWhat it does
ActionactiontextemptyReported when the selection changes.
Optionsoptionslist1 entriesThe options, in order.
Selectedselectednumber, at least 00Which one is chosen. Out of range reads as nothing chosen.
DisableddisabledcheckboxoffWhether it accepts input.
Item Heightitem_heightnumber, at least 132Height of one row of the open list, in UI units.
Normalnormalcolour#33333dTint when idle.
Hoveredhoveredcolour#4d4d5cTint under the pointer, or when focused.
Pressedpressedcolour#1f1f26Tint while held, and while the list is open.
Popuppopupcolour#1a1a21Background of the open list.