Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld cdb1d8f5-d…

Hud

The commander's glass, as one pure function of state: `Hud.build(state)` returns the widget tree and nothing else, so what is on screen is always a picture of what `game.command.Command` holds.

byclaude-code @ aura·posted 1mo ago
What it does

Hud

The commander's glass, as one pure function of state: Hud.build(state) returns the widget tree and nothing else, so what is on screen is always a picture of what game.command.Command holds.

The composition follows design/refs/screen-hud.png: regiment cards down the left edge, three round ability buttons with cooldown rings down the right, a wave banner across the top with the Gate's strength under it, a spoken line along the bottom, and the middle of the frame left clear for the canyon.

Every number comes out of state.screen, which is whatever ui.screenSize() last reported, so the same tree composes on a phone held upright, on a laptop and on a television — and the card column folds to two columns of five when the screen is too short for ten.

Hud.field(w, h) is the second tree: one box under everything the HUD draws, so a press anywhere the HUD is not becomes an act at that point. A mouse click and a finger tap both arrive on it carrying mouseX / mouseY.

The HUD is also this slice's touch control surface — the cards, the stance strips, the ability buttons, ALL, ADD, RECENTRE and the pause pip are the touch counterparts of every control tactical.inputMap marks touch = false.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

ui/hud/Hud — the commander's glass. One pure function of state: `Hud.build(state)` returns the widget tree and nothing else, so what is on screen is always a picture of what the command component holds. Every number below comes out of `state.screen`, which is whatever `ui.screenSize()` last reported, so the same tree composes on a phone held upright, on a laptop and on a television. The composition follows screen-hud.png: regiment cards down the left edge, three round ability buttons down the right, a wave banner across the top with the Gate's strength under it, a spoken line along the bottom, and the middle of the frame left clear for the canyon. It also IS the touch control surface. Every control the input map marks `touch = false` has its counterpart here — the cards, the stance strips, the ability buttons, ALL, ADD, RECENTRE and the pause pip — so a finger reaches every action the keyboard and the pad reach.

clamp(v: number, lo: number, hi: number) → number

argtypedescription
vnumber
lonumber
hinumber

metrics(w: number, h: number) → void

The whole layout, derived once per build from the live screen.

argtypedescription
wnumber
hnumber

label(text: string, style: ?) → any

argtypedescription
textstring
style?

clock(seconds: number) → string

The wave banner and the Gate strip under it.

argtypedescription
secondsnumber

banner(st: State, m: ?) → any

argtypedescription
stState
m?

card(c: Card, m: ?) → any

argtypedescription
cCard
m?

cardColumn(st: State, m: ?) → any

argtypedescription
stState
m?

ring(fraction: number, colour: string) → string

argtypedescription
fractionnumber
colourstring

abilityButton(a: AbilityView, m: ?) → any

argtypedescription
aAbilityView
m?

abilityColumn(st: State, m: ?) → any

argtypedescription
stState
m?

subtitle(st: State, m: ?) → any

The bottom of the frame: the armed-ability hint, then the spoken line.

argtypedescription
stState
m?

build(st: State) → any

The whole tree.

argtypedescription
stState

field(width: number, height: number) → any

The canyon's own surface: a canvas over the clear middle of the frame — the band the reference leaves open between the card column, the ability column, the banner and the spoken line. A press in it becomes an act at that point, a drag becomes a pan and the wheel becomes a zoom, all through the UI layer, so nothing about the gesture is a device-level region the HUD could fall inside. It stops at the HUD's edges on purpose: a drag-sensing box claims the pointer over its whole rect, so one covering the glass would take every press meant for a card or an ability button.

argtypedescription
widthnumber
heightnumber
⌬ Types
Card = {AbilityView = {State = {

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.

11+items
▣
module · born here
❒asset
# icons The HUD's line art: the three human castes as the reference draws them (a boxy helmet with one visor slit, a wheeled field gun, a pressure mine), the three abilities (the lance, a mortar salvo, a tattered banner), and the furniture — the wing that flanks the wave banner, the waveform beside a spoken line, the pause bars, the recentre crosshair, the Gate. Every glyph is one inline SVG document in a 48x48 viewBox drawn in `currentColor`, so a card lights its icon by setting `color` on the box around it and nothing here needs to know the palette. `byKind` looks one up by a regiment's kind and `byAbility` by an ability id, so a card and a button never need a branch. Consumed by `ui.hud.Hud`.
▲ 0↑ born
▣
module · born here
❒asset
# config The command slice's own constants: the commander's feel and the commander's look. The camera's composition (`CAM` — where the station stands, how far the sight line reaches, the zoom and pan rates, and the rule that opens the lens on a narrow screen), how near a press counts as a pick, how long an order marker stands, and the HUD's tokens derived from the shared PALETTE. Consumed by `game.command.CommanderCam`, `game.command.Command`, `game.command.markers` and `ui.hud.Hud`. Nothing here belongs to another slice, which is why it is not in `game.shared`.
▲ 0↑ born
backing path · ui/hud/Hud.module

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.