Match Flow Kit: Countdowns, Rounds and Results
README.md
hud
The in-play readout, in seven layouts and three looks (minimal, scifi, cartoon). Every layout draws the same match from the same data, honours the last-five-seconds pulse (urgent), the clock label, the format/info line, players who are out or left (dimmed), long names (trimmed to fit), and 0, 1 or 8+ players. Each has a real phone layout (narrow) that fits a 248 pt sliver. MatchFlow calls it during the countdown and play with layout = hudLayout.
local Hud = require("MatchFlow.hud")
local node = Hud.render(look, data, { w = 1280, h = 702, k = 1, t = os.clock(), narrow = false, layout = "versusBar" })
opts: w, h (the canvas in points, default 1280x702), k (scale, default fits 1280x702), t (a clock in seconds for pulses and blinks), narrow (a phone held upright; default w < 640), layout (default and fallback for unknown ids: classic), id, position/left/top for the root. Classic only: board = false hides the scoreboard. The node is run through T.solid, so no size ends up read as a fraction of its parent.
Layouts (Hud.LAYOUTS, in order)
| id | label | what it shows |
|---|---|---|
classic | Top Timer + Scoreboard | Timer at the top centre with the format chip under it, standings top right. On a phone the board moves under the timer and keeps four rows, always including you. Exactly the original HUD. |
cornerTimer | Corner Timer | Compact timer top left, the clock label and info beside it, a progress line, and your own place and score (or the leader's when you are watching). |
scoreBug | TV Score Bug | Broadcast bar top left: blinking LIVE, three-letter tags and scores of the leaders (you always included, highlighted), the clock cell (red when urgent), and a strip with the format and round pips for best-of matches. Shows as many players as fit. |
versusBar | Versus Bar | You (or the leader when you are not playing) on the left against the best other player on the right, scores facing each other, the clock between them, a tug bar of the score share and the format chip. One player shows "No rival yet", none "No players". |
timerStrip | Timer Strip | Only the clock: a thin strip across the top with the format left, info right, a progress line along its edge and the clock in a tab hanging from the middle. No scoreboard. |
rankedSidebar | Ranked Sidebar | Clock panel and a full ranked list down the right side: medals for 1st-3rd, avatars, gap to the leader ("-3 pts", "+1.20" in a race), out/left players struck through, your row lit. When rows run out of room the list keeps the top and you, with "+N more". |
holdMeter | Hold Meter | King of the hill: who holds the hill (crown), a meter per player filling toward the hold target with a dot on whoever is on the hill, a pulsing CONTESTED state, and the clock. Without data.hold it draws each score toward data.target, or against the leader's score when there is no target. |
Hud.layoutId(id) returns the id when it is one of these, else nil.
Hud.sample(layout, t?) returns realistic data for a gallery: five players (you second, one with a long name, one who left), a best-of match, and for holdMeter a king-of-the-hill match with its hold table. With t the clock runs down a 90 s round, scores grow, and the hill changes hands every 4 s (Nova holds, contested, Rook holds).
Data (MatchFlow.view.hud(...))
| field | meaning |
|---|---|
clock, clockFrac, clockLabel, urgent | "0:24", 0..1 of the round left, "Time left"/"Elapsed"/"Turn", true in the last seconds. No clock hides the timer. |
format, formatId, info, valueLabel | "King Of The Hill", "kingOfTheHill", "Round 2 of 3", "PTS"/"SEC"/"KOs"/"TIME". |
rows | Best first: { id, place, name, value, detail, isLocal, out }. value may be a string (race times, "DNF"). |
round, rounds, target | Current round; rounds in a best-of; target score (firstToScore, bestOf, kingOfTheHill). |
hold | King of the hill only: { target, holderId, holderName, contested, count, rows = { { id, name, place, value, frac, isLocal, holding, out } } }. |
Any field may be missing.