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; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
slot | MahjongSlot | The zero-based slot index or slot coordinates specified by this signature. |
layers | number | 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 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。