hud
The in-play HUD as a pure function of the game's view.
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.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2metropolisUi.screens.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 Present.hud(game:view(id), t) returns (modules.present; README, "HUD data contract"): paint, arms, colour, target, vehicle, 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 right vehicle what she is driving, how fast, whether it has been called in, the van's stock bottom left paint tool, colours and how much of each, room in the satchel; above it the arm in hand, what is loaded and what is left; above that her own colour while it is not whole beside the reticle the target's cover: each part's paint, and what happens when it is painted out the screen's edges grey in from the sides as her colour is stripped (settings: wash_effect = "meter" turns it off) 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).
attention(p: any, env: any) → any
| arg | type | description |
|---|---|---|
| p | any | |
| env | any |
compass(p: any, view: any, env: any) → any
| arg | type | description |
|---|---|---|
| p | any | |
| view | any | |
| env | any |
purse(view: any, env: any) → any
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
tin(pg: any, most: number, patterns: boolean) → any
| arg | type | description |
|---|---|---|
| pg | any | |
| most | number | |
| patterns | boolean |
paint(view: any, env: any) → any
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
arms(view: any) → any
the arm in hand: its name, what is left in it, the pigment loaded and what that pigment does
| arg | type | description |
|---|---|---|
| view | any |
colour(view: any) → any
her own colour: shown only while it is not whole
| arg | type | description |
|---|---|---|
| view | any |
kit(view: any, env: any) → any
bottom left: her colour, the arm, the paint
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
wash(view: any) → any
the screen's edges grey in as her colour is stripped
| arg | type | description |
|---|---|---|
| view | any |
target(view: any, env: any) → any
beside the reticle: how painted the thing she is aiming at is, part by part
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
vehicle(view: any, width: number) → any
what she is driving
| arg | type | description |
|---|---|---|
| view | any | |
| width | number |
wall(view: any, env: any) → any
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
objective(view: any, env: any) → any
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
notes(env: any) → any
| arg | type | description |
|---|---|---|
| env | any |
banner(env: any) → any
| arg | type | description |
|---|---|---|
| env | any |
grab(p: any, env: any) → any
| arg | type | description |
|---|---|---|
| p | any | |
| env | any |
reticle(view: any, env: any) → any
the reticle: where the tool points on a wall, in the colour loaded; hollow when the wall is out of the tool's range, with the signing hold drawn round it while that runs
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
marks(view: any, env: any) → any
an eye over the head of everyone who is watching: how much they have seen (the same meters as the compass, where the watcher stands on the screen)
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
build(view: any, env: any) → any
Build the HUD tree. See the header.
| arg | type | description |
|---|---|---|
| view | any | |
| env | any |
add(node: any?) → void
| arg | type | description |
|---|---|---|
| node | any? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.