本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス · SVGの図柄と見た目

LayoutSvgOptions型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

Native tile, highlight, artwork, cloth and layout-view choices for SVG rendering.

インポート

import type { LayoutSvgOptions } from "@johnmorrisdotca/jarajara/faces";

定義

type LayoutSvgOptions = {
    chosen?: number | null;
    hinted?: readonly number[];
    matching?: readonly number[];
    found?: {
        free: readonly number[];
        blocked: readonly number[];
    };
    showFree?: boolean;
    hideBlocked?: boolean;
    marked?: readonly number[];
    prefix?: string;
    design?: TileDesign;
    redFives?: boolean;
    redFrom?: string;
    cloth?: Cloth | string;
    symbols?: boolean;
    margin?: number;
    mirror?: TileMirror | string;
};

メンバー

名前型説明
chosen (省略可)number | null | undefined

The slot chosen, ringed and tinted.

hinted (省略可)readonly number[] | undefined

Slots ringed as a hint.

matching (省略可)readonly number[] | undefined

Slots ringed softly: the tiles that match the one chosen, when a page lights them.

found (省略可){ free: readonly number[]; blocked: readonly number[]; } | undefined

What Find lights, as matchesOf gives it: a free match (one that could be taken with the tile now) in a solid ring and tint, a blocked one in a dashed ring, so colour is never the only difference.

showFree (省略可)boolean | undefined

Wash every blocked tile darker, so the free ones stand out.

hideBlocked (省略可)boolean | undefined

Draw a blocked tile blank, its face not shown, as in the blackout challenge: only a free tile shows what it is.

marked (省略可)readonly number[] | undefined

Slots marked for a challenge (a gold tile, a target suit): a gold ring and corner.

prefix (省略可)string | undefined

The prefix of the face symbols' ids: one a board, when a page draws several.

design (省略可)TileDesign | undefined

A design's drawings instead of Jarajara's own, as loadTileDesign gives it.

redFives (省略可)boolean | undefined

Draw the red fives of a design that has them: the first five of each suit in slot order is red.

redFrom (省略可)string | undefined

The tiles that decide which fives are red, when it is not the ones drawn: a game's tiles as first dealt, so the red five stays the same tile as the others are taken. Unless said, the tiles drawn.

cloth (省略可)string | undefined

Lay the layout on a cloth, a felt behind it with a margin: green, blue, red, black or wood. Unless said, no background.

symbols (省略可)boolean | undefined

Put the faces' symbols in the picture (unless said). A page that draws a board again and again keeps them once, in a <svg> of its own, and says false.

margin (省略可)number | undefined

Frame the drawing on the tiles' drawn extent plus this margin (layoutFrame, shadow left to spill into the margin), so a page that centres the picture centres the tiles. Unless said, the old box (layoutBox), which leaves room for the thickness whether or not it is used.

mirror (省略可)string | undefined

The view: none (unless said), horizontal (left to right), vertical (top to bottom) or both. The thickness, the lift of the layers and the shadows follow it; the slots do not.

例

import type { LayoutSvgOptions } from "@johnmorrisdotca/jarajara/faces";

const value: LayoutSvgOptions = {showFree:true,cloth:"green"};
console.log(value);
{ showFree: true, cloth: 'green' }

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/jarajara 1.7.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。