# UI Renderer ## Current state `game/src/ui.rs` — procedural primitives on the RGB565 framebuffer, all clipped: `fill_rect`, `draw_rect` (1 px outline), `draw_hbar` (value/max bar). The HUD (`Game::render_hud` in `game.rs`) lives in the 80 px strip right of the 240×240 viewport: player name, HP bar, population counters, a divider, then the message log filling the rest bottom-up (newest line always visible, lines wrapped to the panel). The log is a `VecDeque` fed from `Sim` events in `Game::handle_events`. Draw order: world, then HUD. The HUD overwrites the right-edge bleed of the tile pass, which is why there is still no clip-rect on the blit primitives. ## Open questions - Tileset-based borders vs. line-drawing: line-drawing for now (`draw_rect`); a 9-slice ornament frame like `wds` has is an option once the look matters. - Does the message log need scrolling? Not yet — `LOG_LINES` keeps 40, the panel shows what fits.