本文へ移動

Jarajaraジャラジャラ

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

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

目次

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

tileAt関数

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

Where a slot's tile face is drawn, raised by its layer along the thickness's direction. With a view that turns the board (mirror) the layout's width and height in half-tiles are needed too.

インポート

import { tileAt } from "@johnmorrisdotca/jarajara/faces";

定義

function tileAt(slot: MahjongSlot, layers: number, mirror?: TileMirror, extent?: { width: number; height: number; }): { x: number; y: number; }

引数

名前型説明
slotMahjongSlot

The zero-based slot index or slot coordinates specified by this signature.

layersnumber

The total number of stacked layers.

mirror (省略可)"none" | "horizontal" | "vertical" | "both"

The native mirrored tile orientation.

extent (省略可){ width: number; height: number; } | undefined

The complete layout width and height.

戻り値

{ x: number; y: number; }

Where a slot's tile face is drawn, raised by its layer along the thickness's direction. With a view that turns the board (mirror) the layout's width and height in half-tiles are needed too.

例

import { layoutExtent, layoutFor } from "@johnmorrisdotca/jarajara";
import { tileAt } from "@johnmorrisdotca/jarajara/faces";

const layout = layoutFor(4)!;
console.log(tileAt(layout.slots[0],layoutExtent(layout).layers));
{ x: 5, y: 15 }

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

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

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