Reference · SVG faces and looks
TileDesigntype
A SET OF DRAWN TILES, a design: how the tile itself is drawn, its back, and each face's picture. Every drawing is
what goes inside an <svg> of the design's own box, so a design may be drawn at any scale (Jarajara's own is in a
box 30 by 40, the riichi sets in one 300 by 400) and is fitted to the tile's 30 by 40 when it is used.
Import it
import type { TileDesign } from "@johnmorrisdotca/jarajara/faces";
Definition
type TileDesign = {
name: string;
box: readonly [
number,
number
];
body: string | null;
back: string;
faces: Readonly<Record<string, string>>;
red?: Readonly<Record<string, string>>;
colours: {
face: string;
rim: string;
side: string;
sideEdge: string;
body?: string;
};
plate?: string;
};
Members
| Name | Type | Description |
|---|---|---|
name | string | The design's name, as an element's |
box | readonly [number, number] | The width and height each tile's drawing is made in. |
body | string | null | The tile's own plate, the ivory the face is on, with its rounded corners; null for the plain rounded rectangle Jarajara draws. |
back | string | The back of a tile, plate and pattern, as a tile lying face down shows it. |
faces | Readonly<Record<string, string>> | Each face's drawing, by its code ( |
red (optional) | Readonly<Record<string, string>> | undefined | The red fives, by the face's code ( |
colours | { face: string; rim: string; side: string; sideEdge: string; body?: string; } | The colours the tile's thickness and rim are drawn in where a board stacks tiles. |
plate (optional) | string | undefined | What is drawn on the plate under a face the design has no drawing for, so Jarajara's own ink reads on it: a light panel on a dark tile. |
Examples
import type { TileDesign } from "@johnmorrisdotca/jarajara/faces";
import { jarajaraDesign } from "@johnmorrisdotca/jarajara/faces";
const value: TileDesign = jarajaraDesign();
console.log(value.name);jarajaraWhat it prints (run when this page was built)