GUI Toggles
App: apps/gui_toggles/
Demonstrates the three selection-state widgets: checkbox for independent toggles, radio for exclusive group selection, and selectableLabel for list selection.
Run from root
Section titled “Run from root”% ./plume3d gui_togglesWhat it shows
Section titled “What it shows”- Checkboxes — four independent toggles (shadows, vsync, fullscreen, debug). Each is stored in its own
Boolvariable and updated each frame. - Radio buttons — quality level (Low/Medium/High/Ultra). Implemented as four radio calls sharing an integer index; only one can be active at a time.
- Selectable labels — an item list (
_items) where clicking sets_selectedItem. Shows bothalignandselectedparameters.
Key patterns
Section titled “Key patterns”// Independent checkbox_shadows = Gui.checkbox("Enable Shadows", _shadows)_vsync = Gui.checkbox("VSync", _vsync)
// Exclusive radio group (compare against index)if (Gui.radio("Low", _quality == 0)) _quality = 0if (Gui.radio("Medium", _quality == 1)) _quality = 1if (Gui.radio("High", _quality == 2)) _quality = 2if (Gui.radio("Ultra", _quality == 3)) _quality = 3
// Selectable label list (align=17 = NK_TEXT_LEFT)for (i in 0..._items.count) { if (Gui.selectableLabel(_items[i], 17, _selectedItem == i)) { _selectedItem = i }}Gui.label("Selected: %(_selectedItem >= 0 ? _items[_selectedItem] : "none")")