Example: Board Game
On this page
examples/board-game is a printable party board game: 40 tiles in a ring from START to FINISH, special tiles, a title and rules panel with a tile guide, dice and pawns. The design is the board, and every card in the card file is a different board with its own tiles and color theme.
yoshida check examples/board-game
yoshida render examples/board-game --out out --date 2026-10-09
# wrote out/boards/road-trip.png (4961 x 3508)
# wrote out/boards/moon-base.png (4961 x 3508)
# wrote out/boards/beach-party.png (4961 x 3508)

Files
board-game/
designs/board.design.json
cards/boards.cards.json (set "boards": road-trip, moon-base, beach-party)
assets/fonts/BebasNeue-Regular.ttf
There is no yoshida.json: the JSON card file names its design, and the set is named after the file (boards). See Command Line.
How it is built
- Canvas: 4961 x 3508 px with
"dpi": 300, which is A4 landscape. PNG and PDF files carry the size, so the board prints at 100 % without guessing.yoshida render examples/board-game --pdfgives one PDF with a page per board. - Tiles come from a list param
tileswith the item fieldskind,textandn.kindis an enum item field (start,finish,plain,safe,skip,back,forward,shortcut,dare, defaultplain), so a typo in card data is error 2006. The list runs clockwise from the top-left corner; the first item is START, the last FINISH.nis the number of steps forbackandforwardand the target tile forshortcut. - One tile is one repeated group. The group
tilerepeats overtiles, and itstranslateputs each iteration at its place in the ring with two functions,tile_x(i)andtile_y(i)(13 x 9 tiles of 170 px). The layers inside use tile coordinates, 0 to 170, and read their own tile's values (t.kind,t.text). - A hidden base layer: inside the tile,
tile_basehas"visible": falseand holds the box and radius.tile_shadowandtile_bgextend it and setvisibleback totrue. - Icons: each tile kind has a polygon icon with
"visible": "t.kind == 'skip'"and so on, inside the grouptile_icon. That group and the numbertile_nare the two children oftile_mark, a row layout that centres them together on the tile; on tiles without a number the hidden text takes no room, so the icon is centred alone. - Tile kinds: the background color is a chain of ternaries over
t.kindand thec_*color params. - Text shrinks to fit the tile (
wrap,max_width,max_height,min_size), and"shrink_group": "tile_text"gives every tile the same size, the smallest any tile needs. See Layer: text. - Themes: the
c_*color params (paper, ink, frame, panel, text, accent, and one per tile kind) are grouped as "Theme colors", so a card is a theme. - Rules are a list param. Each rule is one iteration of the repeated group
rule(badge, number and text), and the group around it,rule_list, is a column layout, so a rule that wraps onto two lines pushes the next ones down. The rule text has"markup": true, so a card can write<b>START</b>; see Layer: text. - Gradients: the paper is a radial gradient from the paper color to a slightly darker edge, and each pawn has a radial highlight.
- The tile guide repeats over a second list param,
legend, whosekindfield is an enum too.
The design is 585 lines after yoshida fmt and can be edited by hand or in the editor.
Ideas to take it further
- Links between tiles. A shortcut tile can draw an arrow to its target with an indexed reference and an open polygon with
"arrow": "end":[["@tile_bg[i].bounds.cx", "@tile_bg[i].bounds.bottom"], ["@tile_bg[t.n - 1].bounds.cx", "@tile_bg[t.n - 1].bounds.top"]], dashed with"dash": [10, 6]. The example does not, because the arrows would cross the rules panel. - Symbol glyphs instead of polygons. Arrows, stars and dice faces now come from the bundled symbol font when the layer font lacks them, so
"text": "★"works with Bebas Neue. - Boards that share a layout. Give
tilesa default list and let each card change only some tiles:"tiles": { "11": { "kind": "safe" } }. See Params. - Layer budget. A tile draws 6 to 8 visible layers (the tile group, shadow, background, number, text, the icon group and the icon or number on special tiles), about 330 per card. The limit is 500 visible layers per card;
yoshida checkreports cards over it. See Repeat.