hud
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
hud
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.ui.hud — the minimal field HUD: * a small parchment-edged plate in the top-right: area name + gold * a menu button (touch/mouse) beside it * toast notifications sliding in under it ("Obtained: Honey Tonic ×2") local Hud = require("game.ui.hud") Hud.attach() -- subscribe to inventory/party/gold/area events Hud.toast("Wren joined the party!", "party") -- icon: an item id or theme icon name Hud.setVisible(false) -- hide during battle / title / cutscenes Toasts are timed by a task loop (fade in, hold, fade out) so they work with or without CSS animations ticking.
itemName(id: string) → string
| arg | type | description |
|---|---|---|
| id | string |
goldPlate(W: number) → void
| arg | type | description |
|---|---|---|
| W | number |
toastNode(i: number, t: any, W: number) → any
| arg | type | description |
|---|---|---|
| i | number | |
| t | any | |
| W | number |
build( ) → any
refresh( ) → void
setVisible(v: boolean) → void
| arg | type | description |
|---|---|---|
| v | boolean |
isVisible( ) → boolean
setMenuHandler(fn: (() → void
Called when the HUD menu medallion is clicked/tapped.
| arg | type | description |
|---|---|---|
| fn | (( |
loop( ) → void
toast(text: string, icon: string?, seconds: number?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| icon | string? | |
| seconds | number? |
quiet(seconds: number) → void
Silence automatic toasts for a moment (save loading, new game reset).
| arg | type | description |
|---|---|---|
| seconds | number |
attach( ) → void
detach( ) → void
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.