Reference · Tiles, layouts and deals
layoutExtentfunction
The layout's extent in half units: how far right and down its tiles reach, and how many layers.
Import it
import { layoutExtent } from "@johnmorrisdotca/jarajara";
Definition
function layoutExtent(layout: MahjongLayout): { width: number; height: number; layers: number; }
Parameters
| Name | Type | Description |
|---|---|---|
layout | MahjongLayout | The native stacked tile positions. |
Returns
{ width: number; height: number; layers: number; }
The layout's extent in half units: how far right and down its tiles reach, and how many layers.
Examples
import { layoutExtent, layoutFor } from "@johnmorrisdotca/jarajara";
const layout = layoutFor(4)!;
console.log(layoutExtent(layout));{ width: 8, height: 2, layers: 3 }What it prints (run when this page was built)