glyphs
The arcade display face. Every word the staging slice puts on screen is drawn INTO a pixel canvas rather than laid out by the UI system, because an attract card is art: it lives in world space behind and in front of the camera moves, and it has to survive the same nearest-neighbo…
staging.glyphs
The arcade display face. Every word the staging slice puts on screen is drawn INTO a pixel canvas rather than laid out by the UI system, because an attract card is art: it lives in world space behind and in front of the camera moves, and it has to survive the same nearest-neighbour sampling everything else in this game does.
A glyph is 5 wide and 7 tall, drawn at an integer scale so a letter is always a whole number of sheet pixels. Uppercase, digits, and the punctuation the opening needs.
local Glyphs = require("emberline.staging.glyphs")
Glyphs.write(K, "ROUND ONE", 240, 60, {
scale = 6, align = "center", fit = 290,
color = "paper", outline = "ink", outlineWidth = 2, shadow = 3,
})
write(K, text, x, y, opts) -> width—x, yis the line's left edge and bottom row unlessalignis"center"/"right".measure(text, scale, tracking) -> width— for laying a line out yourself.block(K, lines, cx, y, opts)— several centred lines.
opts.fit is a width the line must not exceed; the scale steps down until it
does. Pass it on any card whose copy can change — a line that runs off the
sheet is cropped by the canvas, not wrapped.
opts.outlineWidth and opts.shadow are in SHEET pixels, never in glyph
scales. An outline that scales with the type closes the counters and the gaps
between letters, and a headline turns into a black slab with some lighter
shapes cut out of it.
opts.gradient = { bottomColor, topColor } fills the top three rows of every
glyph with the second colour — enough to make a logotype read as lit.
Scoped to this part · feeds back into the world's score.