Cards
The five authored screens of *First Light: Resown* — the title, the how-to, the pause card and the two endings — each a printed page of the previous keeper's almanac laid over a dimmed, frosted hillside.
Cards
The five authored screens of First Light: Resown — the title, the how-to, the pause card and the two endings — each a printed page of the previous keeper's almanac laid over a dimmed, frosted hillside.
local Cards = require("game.ui.Cards")
local tree = Cards.tree("title", { focus = "begin", device = "kbm", portrait = true }, FL.state)
Cards.tree(screen, view, state)returns the tree fortitle,howto,paused,won,lost— andnilforplaying, where there is no card.Cards.ROWS[screen]is the ordered ring the stick walks; hand it togame.ui.Focus.Cards.ROW_LABELis what each row reads.viewcarriesfocus(the lit row id),device(kbm/gamepad/touch, which decides the hint under the rows) andportrait.
Row ids are begin, howto_open, howto_back, resume, restart,
to_title. Each row is a real tap target (its own onClick), a real click
target, and a focus stop drawn with a bronze ring when it is lit — so a finger,
a mouse, a keyboard and a controller all reach the same thing.
Shape
Every measure is a fraction of the live screen. Two rules do the work:
pageWidth(short, wide)— on a tall frame the page is a fraction of the short edge and nearly fills it; on a wide one it is a fraction of the width and becomes a centred column with the hillside showing either side.- The how-to lays itself out by aspect. Stacked down a tall frame; split into two columns on a wide one, where height is the scarce axis instead of width. Its control rows stack their keycaps under the action name in the narrow column and put them beside it in the wide one, so a label and three caps never run into each other.
A wrapping label breaks against its container, never against itself, so every
run of prose on a card goes through para(), which hands it a full-width box.
Scoped to this part · feeds back into the world's score.