Standings.component
README.md
Standings
The grand prix standings screens, drawn on this machine. Put it on any entity of a scene with a GrandPrix (entity named GrandPrix, or the one grandPrix names). It reads gp:phase() and gp:standingsView() ({ cup, table, lastRace, final, secondsLeft }, the shape GP.sample("standings") / GP.sample("final") return) and shows:
- After each race (
phase == "standings"): a header with the cup, "Race 2 of 3" and the track just raced; the race result (finish order, swatch, time or DNF, points earned); and the cup table: place, place change since the previous race (up/down arrows with the number of places), name with a YOU tag on the local player's highlighted row, kart swatch in its paint, vehicle and CPU/PLAYER, a cell per race (points when rows carryracePoints, otherwise the finish place; DNS/OUT for races not run), and the total. The entrance plays in order: rows slide in standing where they were before the race, "+N" chips pop beside each total, totals count up as the chips fly on, then rows slide to their new places and the arrows pop in. Racers knocked out in an elimination cup are dimmed, struck through and stamped ELIMINATED (OUT in later races). A footer counts "Next race in N" (secondsLeft) and names the next track. - At the end of the cup (
phase == "podium"): the top centre of the screen stays clear for the 3D podium; a compact final table (gold, silver and bronze plates for the top three, wins, totals counting up) sits bottom left and a big CHAMPION banner with the winner's name, points and wins sits bottom centre. On a portrait phone the banner sits mid screen with the table under it.
With no GrandPrix in the scene, preview shows the screen with GP.sample data so a look can be built and checked without the race flow.
On narrow screens (phones, either way round) the race result shows first and the cup table follows after about 3.6 seconds, with tabs showing which is up. Every size and type scales from the screen size.
Enter, Space, gamepad A or a tap on the Skip button jump the entrance to its settled state. If the GrandPrix has a requestContinue() method, the button reads Continue once the screen has settled and the same inputs call it; without one, no Continue button is shown.
Fields
style: the look, one ofbroadcast(TV sports graphics: dark slab panels, yellow accents, slanted tabs, rows wiping in),podium(ceremony: navy glass, gold hairlines, serif type, gold/silver/bronze plates, a shining gold champion ribbon),pixel(8-bit scoreboard: blocky white frames, step shadows, pixel lettering fromgrandPrixKit.pixelType, stepped motion, blinking 1UP and prompts),cartoon(cream speech bubbles, thick ink outlines, comic type, bouncy entrances, a wobbling champion bubble) orminimal(white card, clean sans serif, thin dividers, blue accent). The catalog isgrandPrixKit.standingsStyles.preview:"","standings"or"final": sample data when there is no GrandPrix.previewElimination: preview data as an elimination cup (last place drops out each race).grandPrix: name of the GrandPrix entity (defaultGrandPrix).scale: size multiplier on top of the automatic fit.layer: UI layer of the screen (default 60).
Methods
replay(): play the entrance again from the start.seek(seconds): jump the entrance to that time (9 or more is the settled screen); for captures.