Cards
A card (kind: card) is a flat component that flips between a front
and a back. The front is required — a card must show something face-up —
and the back is optional, shared across the whole deck so a face-down stack
looks uniform.
Cards behave like every other component: players drag, flip, and deal them by hand. taybl doesn’t deal turns or enforce who may look at a card — that comes from the zone a card sits in (a face-down draw pile, an owner-only hand).
How to edit in the Studio
Open your game → Layout tab and select the card to set its name, front
art, and behaviors. Grouping cards into a deck — assigning a shared back and
a group id to a whole set at once — is done from the Decks tab of the
game-settings editor; see decks. The variants shorthand
below is an authoring/generation convenience rather than an inspector
control.
Card fields
| Field | Values | Default | What it does |
|---|---|---|---|
kind | card | — | Marks this component as a card |
faces.front | FaceBinding | — | Required. The face-up art (a card must have a front) |
faces.back | FaceBinding | .optional() | The shared face-down art; usually the same image across a deck |
group | component id | .optional() | Deck id — lets setup place a whole deck at once (e.g. deck_standard_52) |
variants | array of CardVariant (≥ 1) | .optional() | Authoring shorthand for a large unique deck — expanded at normalize time (below) |
A card shares the rest of its fields with every kind — see
components overview. To turn a card face-down,
it needs the flippable behavior; the Decks flow sets that
for you when you assign a back.
Variants — one entry for a whole unique deck
Most decks are a hundred different fronts sharing one back. Writing a
hundred near-identical card entries is tedious, so a card may instead carry a
variants[] list. The normalize pass expands it into one determinate
card per variant — each gets the variant’s own front, the parent card’s
shared faces.back, and the parent’s group. The runtime, renderer, and
validator only ever see the expanded ordinary cards; variants never reaches
them.
Each CardVariant has:
| Field | Values | Default | What it does |
|---|---|---|---|
id | lowercase snake_case | — | Becomes the expanded card’s id (parent_id + _ + this) |
front | FaceBinding | — | This variant’s determinate face-up art |
name | text | .optional() | Defaults to the parent card’s name |
count | integer ≥ 1 | .optional() | Copies of this variant (e.g. four of a value) |
properties | record of string / number / boolean | .optional() | Per-variant data tags (suit, rank) |
Related
- Components overview — shared fields
- Decks — grouping cards and assigning a shared back
- Zone roles — draw piles, hands, discards
- Zone visibility — who can see a card’s front
- Setup automation — shuffling and dealing a deck