Skip to main content

Module ui

Module ui 

Source
Expand description

Immediate-mode UI toolkit.

Unlike macroquad’s ui which requires a separate Ui root and widgets module, game-gem’s UI is designed to be:

  • Drop-in simple: call ui::button(ctx, "Click me", rect) — done
  • No tree building: no begin() / end() pairs required
  • Styling: global theme + per-widget overrides
  • Layout helpers: vertical/horizontal stacking, spacing, alignment
  • Keyboard navigation: tab between widgets, Enter to activate

Structs§

HorizontalLayout
Simple horizontal layout helper.
KeyModifiers
Keyboard modifier state.
TextInputState
State for a text input widget.
UiInteraction
Result of a UI interaction.
UiState
Tracks per-widget interaction state across frames.
UiTheme
Global UI theme.
VerticalLayout
Simple vertical layout helper.

Functions§

button
Draw a button and return whether it was clicked.
checkbox
Draw a checkbox and return whether it’s checked.
label
Draw a text label. Returns its rect for layout purposes.
progress_bar
Draw a progress bar.
slider
Draw a horizontal slider and return the new value.
text_input
Draw a text input field.