km.ui.hud — the Act 2 command UI as tree builders: the left state panel,
numbered illustrated choice cards along the bottom, the officer caption above
them, the red alert banner and the beat countdown. Layout is computed from
the UI canvas size so the same screens hold on a desktop and a phone.
Pure functions of (state, layout); km.ui.screens owns state and screens.
clamp(x: number, a: number, b: number) → number
| arg | type | description |
|---|
| x | number | |
| a | number | |
| b | number | |
headH(k: number) → number
| arg | type | description |
|---|
| k | number | |
rowHeight(id: string, k: number) → number
Estimated height of each panel row at scale k (includes its padding).
| arg | type | description |
|---|
| id | string | |
| k | number | |
layout(w: number, h: number, nCards: number) → Layout
| arg | type | description |
|---|
| w | number | |
| h | number | |
| nCards | number | |
num(x: any, d: number) → number
| arg | type | description |
|---|
| x | any | |
| d | number | |
rowBox(children: { any }, k: number, last: boolean?) → any
| arg | type | description |
|---|
| children | { any } | |
| k | number | |
| last | boolean? | |
treatyWord(t: number, inZone: boolean, violated: boolean) → void
| arg | type | description |
|---|
| t | number | |
| inZone | boolean | |
| violated | boolean | |
panelRow(id: string, T: any, k: number, focus: string?) → any
| arg | type | description |
|---|
| id | string | |
| T | any | |
| k | number | |
| focus | string? | |
prow(name: string, key: string, color: string) → any
| arg | type | description |
|---|
| name | string | |
| key | string | |
| color | string | |
crow(name: string, v: number, color: string, wid: string) → any
| arg | type | description |
|---|
| name | string | |
| v | number | |
| color | string | |
| wid | string | |
panel(st: any, lay: Layout) → any
| arg | type | description |
|---|
| st | any | |
| lay | Layout | |
costText(card: any) → string
| arg | type | description |
|---|
| card | any | |
chip(text: string, good: boolean, k: number) → any
| arg | type | description |
|---|
| text | string | |
| good | boolean | |
| k | number | |
card(card: any, n: number, lay: Layout, beat: number, locked: boolean, pressed: string?) → any
| arg | type | description |
|---|
| card | any | |
| n | number | |
| lay | Layout | |
| beat | number | |
| locked | boolean | |
| pressed | string? | |
cards(st: any, lay: Layout) → any
| arg | type | description |
|---|
| st | any | |
| lay | Layout | |
arrow(txt: string, cb: string, id: string) → any
| arg | type | description |
|---|
| txt | string | |
| cb | string | |
| id | string | |
caption(st: any, lay: Layout) → any
| arg | type | description |
|---|
| st | any | |
| lay | Layout | |
banner(text: string, seq: number, lay: Layout) → any
| arg | type | description |
|---|
| text | string | |
| seq | number | |
| lay | Layout | |
clock(beat: number, secsLeft: number?, total: number, lay: Layout, over: boolean) → any
| arg | type | description |
|---|
| beat | number | |
| secsLeft | number? | |
| total | number | |
| lay | Layout | |
| over | boolean | |