Log inGet started
World

First Light: Vagant

Branchmain
Branchesmain
Commit2ac9266a40

README.md

flui

The look of First Light: Vagant's screens, in one module. flscreens builds the trees; this builds the pieces they are made of.

local flui = require("ui.flui")

Measure — nothing here is a pixel

Every size is a fraction of the live short screen axis, so the same tree composes on a phone held upright, on a laptop, and on a television.

CallWhat it answers
flui.size()the shape being laid out against
flui.u(f)f of the short axis, in logical points
flui.portrait()is the screen taller than it is wide
flui.cardWidth()how wide a reading column should be
flui.typeSize(scale)a type size, never below its floor

flui.T is the type scale as fractions; flui.TMIN is the floor in logical points beside it, because a reader's eye does not shrink with the screen — on a 390-point phone the fractions alone would land body text at 9 points. flui.TAP (48) is the smallest a thing a finger presses may be.

flui.previewSize lays a build out against a stated shape instead of the live one. Set it, build a tree, read the numbers back, clear it: that is how screens authored in a tall frame are proved to hold in a wide one.

flui.previewSize = { width = 1920, height = 1080 }
local tree = require("ui.flscreens").title(model)
flui.previewSize = nil

Colour

flui.C carries fl.PAL's four UI hexes plus this slice's own, derived from the same palette the fen and the lantern are painted from: ink paper brass blood, the panel steps soot slate iron fog, the light flame lamp dawn, jasey white, water, and the parchment set vellum / vellumEdge / vellumInk.

Pieces

  • Type — flui.text(str, scale, style), flui.para(str, scale, style) (a paragraph always ships inside a full-width box of its own; a wrapping label that carries its own width collapses to one glyph per line), and flui.eyebrow(str, color) for the letterspaced cap line over a heading.
  • Ornament — flui.rule(opts) (a hairline with a diamond set in it), flui.diamond(size, color), flui.svg(str, w, h, style).
  • Surfaces — flui.plate(children, style) for a panel on the dark page, flui.vellum(children, style) for a printed card, flui.scrim(children, style) for the ground a card sits on.
  • Controls — flui.item(opts) is the one menu line: a plate at thumb size carrying its own handler, with a brass ring, a lit edge marker and a diamond when focused. flui.cap(str, kind) draws a keycap, a pad button or a touch target as the thing it is.
  • Glyphs — flui.lampGlyph(lit, height, onLight), flui.wigGlyph(color, height), flui.pauseGlyph(color, size), flui.sunGlyph(color, size).