flscr — every authored screen of *First Light: Goura*, as a widget tree.
`local Scr = require("game.screens.flscr")`
Each builder is pure: it takes the view model `Screens.component` assembles
and returns a widget tree. It registers nothing, shows nothing and reads no
game state, so a card can be built, measured and looked at on its own.
Every length comes from `FL.unit(fraction)` — a fraction of the LIVE
screen's short side — or from `s.w` / `s.h`, so one layout reads the same in
a 3:4 portrait frame, on a phone held either way and on a television. The
HUD is additionally held above 34% of the screen HEIGHT, because the touch
overlay claims the lower-left stick region below 40% of it.
crest( ) → string
Art. Every mark in this game is drawn here as SVG, so it stays crisp at
whatever size the screen asks for.
The crest mark: a Victoria crowned pigeon's head, and the lace-tipped fan
above it that the bird is named for. The game's emblem.
horizon(warmth: number) → string
The lane at dawn, as a band: trunks going up out of the frame, the roost
tree's crown at the end of them, and the sun clearing the canopy from
screen-right. `warmth` 0..1 decides how much gold reaches it.
| arg | type | description |
|---|
| warmth | number | |
callMark(state: string) → string
One of the six call marks. `state` is "answered", "open", "failed" or
"pending".
| arg | type | description |
|---|
| state | string | |
failMark(spent: boolean) → string
One of the three failance marks: a feather still on the bird, or one struck
through.
| arg | type | description |
|---|
| spent | boolean | |
u(f: number) → number
| arg | type | description |
|---|
| f | number | |
fitTo(units: number) → void
`units` is roughly how many short-sides tall the card is in its own numbers.
| arg | type | description |
|---|
| units | number | |
forShape(w: number, h: number, build: () →
Build a tree as it would stand on a screen of a given shape, whatever shape this engine is running at.
| arg | type | description |
|---|
| w | number | The assumed screen width in canvas units. |
| h | number | The assumed screen height. |
| build | ( | A function that returns a tree, called with the assumption in force. |
examples
local tall = Scr.forShape(1080, 1440, function() return Scr.title(vm) end)
svg(markup: string, size: number, color: string?, extra: any?) → void
| arg | type | description |
|---|
| markup | string | |
| size | number | |
| color | string? | |
| extra | any? | |
eyebrow(text: string, size: number, color: string) → void
A line of small letterspaced capitals — the label voice of this game.
| arg | type | description |
|---|
| text | string | |
| size | number | |
| color | string | |
prose(text: string, size: number, color: string, width: number, italic: boolean?) → void
Prose. Always inside a container with a definite width so it wraps.
Prose. The width goes on the CONTAINER and the container stretches its
child: a wrapping label that is centred across its cross axis hugs its
content instead, and wraps to one glyph per line.
| arg | type | description |
|---|
| text | string | |
| size | number | |
| color | string | |
| width | number | |
| italic | boolean? | |
rule(width: any, alpha: string) → void
| arg | type | description |
|---|
| width | any | |
| alpha | string | |
spacer(px: number) → void
| arg | type | description |
|---|
| px | number | |
menuRow(item: any, focused: boolean, w: number, delay: number) → void
A menu row. Every card's actions are these, and each one is reachable by
pointer (click), by finger (the same click), and by the focus ring a pad or
the arrow keys walk.
| arg | type | description |
|---|
| item | any | |
| focused | boolean | |
| w | number | |
| delay | number | |
card(id: string, inner: { any }, gen: number) → void
The card shell: the scrim that darkens the forest behind it, the warm wash
coming in from screen-right, and the panel itself.
| arg | type | description |
|---|
| id | string | |
| inner | { any } | |
| gen | number | |
rows(items: { any }, focusId: string?, w: number, delay0: number) → void
| arg | type | description |
|---|
| items | { any } | |
| focusId | string? | |
| w | number | |
| delay0 | number | |
title(vm: any) → void
The title card: the game's name, the crest mark, the narrated opening line as text, and the two ways in.
badge(kind: string, text: string) → void
The how-to-play card.
| arg | type | description |
|---|
| kind | string | |
| text | string | |
actionBlock(a: any, w: number, delay: number) → void
| arg | type | description |
|---|
| a | any | |
| w | number | |
| delay | number | |
howto(vm: any) → void
The how-to-play card: every action with all three families' prompts, and the failance rule.
paused(vm: any) → void
The pause card: the run held where it stands, with the ways back into it and out of it.
stat(value: string, label: string, color: string) → void
The ledger, shared by the pause card and both end cards.
| arg | type | description |
|---|
| value | string | |
| label | string | |
| color | string | |
ledgerStrip(l: any, w: number) → void
The run's ledger as three figures: calls answered, failances spent, how far up the lane she got.
| arg | type | description |
|---|
| l | any | |
| w | number | |
ending(vm: any) → void
An end card. `vm.won` picks the warm resolution or the cold one; `vm.headline` says which ending it was.
meter(id: string, fill: number, gradient: string, tall: number, wide: number) → void
The HUD: a vertical column at the top-left, held clear of the touch
overlay's stick region (the lower-left 40% x 60% of the screen).
| arg | type | description |
|---|
| id | string | |
| fill | number | |
| gradient | string | |
| tall | number | |
| wide | number | |
stack(children: { any }, gap: number) → void
| arg | type | description |
|---|
| children | { any } | |
| gap | number | |
hud(vm: any) → void
The play HUD: the light rising, how far up the lane she is, the six calls, the three failances.
callBandNode(vm: any) → void
The call band: the open answer window, above the play, with the side the
caller stands on.
subtitleNode(text: string, seq: number, seconds: number) → void
A spoken line, written out. Every narrated line in this game also arrives as
text, so a failed generation, a muted player and a noisy room all still get
the words.
| arg | type | description |
|---|
| text | string | |
| seq | number | |
| seconds | number | |
top(vm: any) → void
The band above the play: the open answer window, and whatever is being said, stacked so neither covers the other.
alert(vm: any) → void
The full-frame pulse and word for the moment the eagle sees her.
padLabel(button: string) → string
The device-prompt vocabulary the how-to card and the call band draw from.
Pad prompts resolve against whatever pad is connected, so the card names the
button a player is actually holding.
| arg | type | description |
|---|
| button | string | |