euca-ui) is renderer-agnostic: it resolves a flex layout into screen-space rects,
emits draw commands, and routes input via hit-testing. Layout, hit-testing, and interaction state all run
headless; only the final draw needs a GPU host. The HTTP surface focuses on the HUD — text and bars
you add, list, and clear.
Headless layout + input, GPU draw. Layout solving, anchor/flex math, button hit-testing, and input
consumption run on the
:3917 server. Game logic can poll button states without
rendering. Only drawing the quads and text needs a render host.What it does
- Layout —
UiNodewith anchors (TopLeft…Stretch),Val::Px/Percent/Autosizing, margins, and flex (FlexDirection,JustifyContent,AlignItems);ui_layout_systemresolves toResolvedRectscreen pixels. - Widgets —
UiText,UiButton(hovered/pressed/clicked state),UiProgressBar,UiImage,UiPanel. - Input routing —
ui_input_systemhit-tests the cursor against resolved rects, updates button state, and sets aUiInputConsumedflag so gameplay input can defer to the UI. - World-space UI — entities with
UiNode+GlobalTransformproject a 3D position to screen via the view-projection matrix (health bars over units, etc.). - Draw output —
collect_ui_draw_dataemits sortedUiDrawCommands (Rect/Text/Image/ProgressBar) for the renderer.
Endpoints
| Method | Path | Description |
|---|---|---|
POST | /ui/text | Add a text element to the HUD |
POST | /ui/bar | Add a bar (progress/health) to the HUD |
GET | /ui/list | List current HUD elements (type, position, size) |
POST | /ui/clear | Remove all HUD elements |
Example
Status
- ✅ Flex layout, anchors, all widget types, button hit-testing, input consumption, world-space projection, draw-command emission — shipped and headless. Drawing the commands needs a render host; fonts/textures are uploaded by the renderer.
UI & HUD endpoints
HUD text, bar, list, and clear endpoints with schemas.