Skip to content

Added large charter type with scale parameter, reworked wide charter layout#26

Open
UvulaBob wants to merge 2 commits into
clearclaw:masterfrom
UvulaBob:wide_and_large_charters
Open

Added large charter type with scale parameter, reworked wide charter layout#26
UvulaBob wants to merge 2 commits into
clearclaw:masterfrom
UvulaBob:wide_and_large_charters

Conversation

@UvulaBob

@UvulaBob UvulaBob commented Jul 9, 2026

Copy link
Copy Markdown

Summary

Added large_charter (resizable, one per page) charter type and reworked wide_charter token layout. Introduced a scale parameter on draw_embed and draw_clone for canvas scaling of embedded tiles and cloned elements, enabling enlarged company logos on large charters and eliminating the need for separate size-variant shape definitions.

Changes

Python (1 file, 6 lines added)

  • tile.py — Added optional scale parameter to draw_embed and draw_clone. When set to a value other than 1, applies canvas.scale() before rendering. Both methods already run inside saveState/restoreState, so the transform is properly scoped. Default is 1 — existing configs are unaffected.

Charter types

  • wide_charter (existing) — Reworked token circle layout from a horizontal row to vertical columns of three.
  • large_charter (new) — Its own tile type (large_charter_tile, 14.6cm × 20.8cm, 1 per page). Full element definitions at the larger size. The token_embed uses scale: 2 to render an enlarged company token in the banner strip.

Config cleanup

  • Hexagon consolidationsmall_hexagon_shape renamed to hexagon_shape. Duplicate hexagon_shape/hexagon_text removed from charter and wide charter objects files — unused by default templates, now fall through to the single definition in XXP_clips.xxp.

Sample game (1828-Papers.xxp)

  • Updated with all three charter variants. Renamed hexagon clones to {charter,wide_charter,large_charter}_track_cost_hex_{upper,lower,label}_clone.

  • Per-company template overrides renamed from TEMPLATE_*_track_hexes to TEMPLATE_*_with_track_hexes for clarity.

  • Large charter hexagon clones use hexagon_shape with scale: 2 instead of separate size-variant definitions.

Design rationale for scale

The alternative to a scale parameter — creating parallel "large" tile types with all coordinates re-specified — would require duplicating every absolute value across 15+ token templates and keeping them in sync. Token art uses a mix of relative coordinates (${token_interior_box/x}) and hardcoded absolute values (circle radii, stripe widths, text sizes), so a pure-config size variant can't just override the interior box dimensions. The scale parameter on draw_embed and draw_clone is a natural extension of the existing canvas transform family (draw_rotate, draw_translate) and lets game files reuse existing element definitions at any size with zero config duplication.

Backwards compatibility

No modifications to the config resolution system, the QUERIES chain, the embed/clone dispatch mechanism, or any existing tile type behavior. All existing game files render identically.

UvulaBob and others added 2 commits July 9, 2026 10:59
…layout

Added large_charter (resizable, one per page) charter type and reworked
wide_charter token layout. Introduced a scale parameter on draw_embed
and draw_clone for canvas scaling of embedded tiles and cloned elements,
enabling enlarged company logos on large charters and eliminating the
need for separate size-variant shape definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants