Screens
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->
Screens
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this component provides and who consumes it, then delete both comment lines. -->TODO: describe this component.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2game.screens.Screens — everything Hidden Love puts on the glass. The title card, the in-play HUD (chapter label, the three relationship bars, the dialogue band, the phone with its unread dot), the phone panel, and the closing card. It DRAWS, AND IT DRIVES. Every word it shows comes off `game.Game.bus`, and every control it draws routes back into `game.story.Story` by calling a method on it. It never reaches into the story's fields and the story never reaches into its tree. TWO THINGS THIS ENGINE REQUIRES, both of which fail SILENTLY: 1. A style value is a NUMBER in logical points. `fontSize = 31` is honoured; `fontSize = "31px"` is dropped on the floor. Colours are strings. A screen that renders as unstyled default text is almost always this. 2. `ui.registerScreen` does NOT replace a screen that already answers to the name — the old tree keeps drawing and the new one is discarded, which looks exactly like "my styles are ignored". Remove first. The layout is the `in-play.png` contract: chapter label top-left, the three bars top-right, the dialogue band across the bottom, the phone bottom-right, and all of it quiet enough that the room is the picture.
story( ) → void
The story we drive
hasSave( ) → boolean
label(id: ?, text: ?, style: ?) → void
Building blocks
| arg | type | description |
|---|---|---|
| id | ? | |
| text | ? | |
| style | ? |
screenSize( ) → void
A root that covers the viewport. An absolutely-positioned box with NO size only wraps its own content, so a scrim built that way covers the panel and nothing else — the world shows through underneath, which reads as "the background is missing" rather than as a sizing mistake. Everything absolute inside is then measured against a root that is actually the screen. The box the HUD is actually drawn into. `ui.screenSize()` reports the WINDOW, and in the editor that is taller than the viewport the game paints into — so anything positioned from its height (a bottom-anchored band, a corner button) lands below the bottom edge and is silently unclickable: `gui.clickElement` answers "offViewport" and the control simply never fires. The viewport's own size is the space a camera-space screen is laid out in.
button(id: ?, text: ?, style: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| text | ? | |
| style | ? |
meterBar(key: ?, value: ?) → void
| arg | type | description |
|---|---|---|
| key | ? | |
| value | ? |
cornerBox(id: ?, left: ?, top: ?, children: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| left | ? | |
| top | ? | |
| children | ? |
titleTree( ) → void
The four screens
hudTree( ) → void
phoneTree( ) → void
endTree( ) → void
show(name: ?, tree: ?, layer: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| tree | ? | |
| layer | ? |
hide(name: ?) → void
| arg | type | description |
|---|---|---|
| name | ? |
draw( ) → void
readStory( ) → void
Reading the story
snapshot( ) → void
sync( ) → void
awake( ) → void
Lifecycle
start( ) → void
onDestroy( ) → void
update(dt: ?) → void
Phase is not on the bus (the story sets it internally), so it is polled. The comparison is a handful of field reads and `draw()` only runs on a change — this is not a per-frame rebuild.
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onCallback(callbackId: ?, data: ?) → void
The controls
| arg | type | description |
|---|---|---|
| callbackId | ? | |
| data | ? |
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.