hud.module
README.md
hud
The in-play HUD as a pure function of the game's view.
local Hud = require("~.screens.hud")
local tree = Hud.build(view, env)
view: what metropolisGame's game:view() returns (README, "HUD data contract"): paint, pursuit, money,
objective, mural, district, clock, scrubs, player; and two things the host adds from the scene:
aim = { hex, inRange, painting, hold = 0..1 }? the reticle on a wall (the tool's colour; the signing hold)
marks = { { x, y, kind, stage, value?, icon? } } screen points over watchers' heads (and places)
env: { frame = Layout.frame(...), text = function(key, vars) -> string, -- the game's copy
glyph = function(control) -> prompts glyph | nil, -- from the input system
prompts = { { control, text, hold? } }, -- what the player can do here, most important first
notes = { { id, icon, text, tone, age } }, -- notifications, newest last
banner = { name, rule, line, colour, age } | nil, -- district banner while it shows
patterns = false } -- pigment patterns on
Regions and what each answers:
top left attention am I being watched, by how much, and what happens next
top centre compass who is watching and where they are
top right purse sous, renown, rank, the hour
right objective what the mission wants now; scrub crews on their way
bottom left paint tool, colours and how much of each, room in the satchel
bottom centre the wall coverage, accuracy and tier of the wall under the reticle; what a control does here
bottom right notes things that just happened
Every region is anchored to its edge, so the HUD holds at any size; at "narrow" and "short" frames the
objective and notes shrink and the compass narrows (see Layout).
The interface is documented in the header of init.luau; this file repeats it for the asset browser.