cards
Every screen HELSINKI LIFE puts BETWEEN the player and the board.
cards
Every screen HELSINKI LIFE puts BETWEEN the player and the board.
local C = require("game.screens.cards")
ui.registerScreen("hl_card", C.title(T.metrics(), { focus = Focus.id() }), 900)
Each builder is pure: it takes the metrics table from game.screens.theme and a
small view model, and returns a widget tree. Nothing here registers a screen,
reads a control or touches the game state; Screens.component does all three and
hands the result in.
| Builder | Card | View model | Focus ids |
|---|---|---|---|
title(m, vm) | the title plate | { focus } | t_start, t_howto |
setup(m, vm) | player count and names | { count, names, focus } | s_count2..4, s_name1..4, s_go, s_back |
howto(m, vm) | how to play | { focus } | h_back |
event(m, vm) | an event card | { card, player, focus } | e_ok |
choice(m, vm) | a fork, a career, a home | { choice, player, focus } | c_opt1..n |
pause(m, vm) | the pause card | { focus } | p_resume, p_howto, p_restart, p_title |
over(m, vm) | the ranking | { ranking, focus } | o_again, o_title |
focusOrder(name, vm) returns the same ids in the order a stick walks them.
Every row a player can act on carries an id that is BOTH its focus id, for the
pad through game.vendor.Focus, and its onClick callback id, for the mouse and
for a finger. The three input families therefore never disagree about what is
selected or what a press does, and the lit row draws a gold ring.
The shape of a card
A card is a scrim, a paper plate, a green header band, a body, and a footer of
actions. T.metrics() sizes all of it: the plate is a share of the screen capped
at a readable measure, so it is nearly full width on a 3:4 phone and a centred
panel on a television, and its height is capped so a long body scrolls rather
than running off the screen.
The setup card's name rows do double duty: tapping a row cycles the tram's name, which a finger and a pad can both do, and the field inside it takes typing for whoever has a keyboard.
Scoped to this part · feeds back into the world's score.