Log inGet started
World

First Light: Luteway

Branchmain
Branchesmain
Commit811e1e6968

README.md

lwui

The design system every authored screen of First Light: Luteway is drawn from. local lwui = require("luteway.screens.lwui").

It builds widget nodes and returns them. It registers no screen, reads no game state and spawns nothing.

Type

Three faces:

lwui.DISPLAYBricolageGrotesque — titles and headings
lwui.SANSArimo — reading
lwui.MONOBerkeleyMono — the clock, the height, every number on the glass

Each stack leads with the name the .font asset is registered under — the names font.list() returns — because that is what the renderer shapes with, then falls back through faces this engine also has.

lwui.T is the type scale in short-axis fractions and lwui.TMIN the floor in logical points beneath which a reader's eye stops coping. lwui.typeSize(scale) resolves one against the other.

Measure

Every number a screen uses comes through lwui.u(f) (a fraction of the SHORT axis — the measure for anything an eye judges), lwui.wf(f) / lwui.hf(f) (a fraction of the width / of the height, for anything that spans), and lwui.portrait() / lwui.cardWidth().

lwui.previewSize lays a tree out against a shape other than the live screen. Set it, build a tree, read the numbers back, clear it: that is how the cards are proved to hold on a 16:9 frame from inside a 3:4 one, with no second engine to look at.

Colour

lwui.C — LW.PALETTE plus this slice's own mixes. The accent and the focus ring are crest, the rockhopper's yellow. paper / paperEdge / paperInk are the how-to card's printed page.

What it builds

  • Text — text, num, para (a paragraph always ships inside a full-width box of its own; a wrapping label carrying its own width collapses to one glyph per line), eyebrow.
  • Motion — entrance(delay, fromY) and breathe(from, to, seconds).
  • Ornament — svg, diamond, rule.
  • Plates — plate (the dark panel), page (the printed field page), scrim (the ground a card sits on).
  • Controls — item (the one shape every menu line uses, with the focus ring, the danger variant and an onPaper variant), cap / capInk (a keycap, a pad button, a touch target drawn as the thing it is).
  • Marks, all inline SVG so nothing here needs an imported texture — rockhopper (the game's mark: black head, white cheek, red eye, orange bill, the yellow crest and supercilium), foot(sticky) (a penguin foot with that much lute caked on it), pauseGlyph, sunGlyph, waveGlyph, and the three how-to figures hopCleanGlyph / hopStickyGlyph / shakeGlyph, each with an inked variant for the paper page.
  • The stickiness scale — luteGaugeVertical(value, w, h) for the HUD and luteScaleHorizontal(width, onPaper) for the how-to card: the same picture in two orientations, ruled at LW.PENGUIN.iceGrip and LW.PENGUIN.clingNeeds, so learning one reads the other.

lwui.live

A table for the little bit of screen state that has to outlive a hot reload. A component's module-level locals belong to the chunk that declared them, and reloading a component reconciles the live instance in place without running awake again; a table exported from a module keeps its identity across that. Screens.component keeps its live schemes here.