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/v2Screens — every authored screen of First Light: Crowfeet, on the glass and driven: the title card, the how-to-play card, the HUD, the pause card, the two end cards, and the caption band that prints every line the Old Crow says. Mounted once on the scene's `screens` entity. It reads CF.state and draws it; the only state it owns is which card is up and which row is focused. THREE FAMILIES, ONE MODEL. Every card is a list of rows, exactly one of them focused, and the focus is lit the same way whoever moved it there: * a pad or the arrow keys move it (console map -> Focus.axis / Focus.step) * the mouse moves it by hovering (ui.pointerWidget -> Focus.point) * a finger moves it by tapping (the row's own onClick) and `confirm` acts on whatever is lit. So no device has a path the others lack, and nothing on screen is reachable by only one of them. EVERY SIZE IS A FRACTION OF THE SHORTER SCREEN EDGE, read live from ui.screenSize() through Theme. At 1080x1440 — the shape this runs at — that is 1080, and on a 1920x1080 television it is also 1080, so the type keeps its size and only the frame changes shape; T.fit() shrinks a tall card into a short frame. Nothing here is a pixel chosen for one screen. Two screens, refreshed differently on purpose. The HUD is rebuilt every frame (its meters move), so its motion is computed by hand rather than declared as a CSS animation, which would restart on every rebuild. The card screen is rebuilt only when something about it changed, which is what lets its entrance keyframes play once and settle. Owned by the presentation slice. See /zero/source/design/spec.md.
ensureMap( ) → void
openMap( ) → void
closeMap( ) → void
act(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
label(text: string, style: ?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| style | ? |
prose(text: string, style: ?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| style | ? |
lines(list: { string }, style: ?) → void
Centred prose, written as the lines it should break on. A `wrap = true` label reflows but always sets flush left — `textAlign` is accepted on it and does nothing (OrigoZero/zero#11753) — so a paragraph that has to sit centred under a centred title is authored line by line instead. Every size here is a fraction of the screen's shorter edge, so each line keeps its proportion of the width it was written for at any screen size.
| arg | type | description |
|---|---|---|
| list | { string } | |
| style | ? |
row(id: string, text: string, sub: string?, animation: ?, scale: number?) → void
One walkable row. Its own id and both its children's ids carry the row name, so a pointer anywhere inside it resolves back to the row it is over.
| arg | type | description |
|---|---|---|
| id | string | |
| text | string | |
| sub | string? | |
| animation | ? | |
| scale | number? |
legend(animation: ?) → void
The strip every card carries: this game answers all three families, and here is what each one presses.
| arg | type | description |
|---|---|---|
| animation | ? |
meter(id: string, name: string, frac: number, fill: string, opts: ?) → void
| arg | type | description |
|---|---|---|
| id | string | |
| name | string | |
| frac | number | |
| fill | string | |
| opts | ? |
hudTree( ) → void
titleTree( ) → void
howtoScale( ) → number
The how-to is the tallest card in the game — five actions, each with three device legends. This is how much of the shorter edge it may spend per row so the whole card still fits the frame it is in: full size on a tall portrait phone, tighter the shorter and wider the screen gets.
howtoTree( ) → void
howtoCard( ) → void
statBlock(name: string, value: string, tone: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| value | string | |
| tone | string? |
statsRow( ) → void
pauseTree( ) → void
endingTree( ) → void
cardTree(which: string, animate: boolean) → void
| arg | type | description |
|---|---|---|
| which | string | |
| animate | boolean |
strip(node: ?) → void
Strip the entrance tracks on a rebuild caused by the focus moving, so walking the rows does not replay the card's opening every step.
| arg | type | description |
|---|---|---|
| node | ? |
desiredCard( ) → string
pointerRow( ) → string
The mouse moves the focus by hovering: the pointer lands on a row or on one of its children, and every one of those ids starts "cf.row.<name>".
drainInput(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
tick(dt: number, interactive: boolean) → void
| arg | type | description |
|---|---|---|
| dt | number | |
| interactive | boolean |
awake( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
editorUpdate(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
onCallback(id: ?, data: ?) → void
| arg | type | description |
|---|---|---|
| id | ? | |
| data | ? |
onDestroy( ) → 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.