layoutFrame関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
THE TILES' DRAWN EXTENT, plus an even margin: the smallest box that holds every tile of a layout as it is drawn, with
its thickness and its layer offsets, in whichever view (mirror) puts them. A page that centres this box centres what
the eye sees, not the grid of slots, so the space from the outermost solid pixel to a frame round it is the same on both
sides. The soft shadow is left out unless shadow is true: it falls one way only, so counting it would push the solid
tiles off centre by its reach; it spills into the margin instead, which is why a frame wants a margin of at least a few
units. Taken tiles do not change the box: it is the layout's, so a game keeps one steady frame. margin defaults to 0.
Null for a size with no layout.
インポート
import { layoutFrame } from "@johnmorrisdotca/jarajara/faces";
定義
function layoutFrame(size: number, options?: { mirror?: TileMirror | string; margin?: number; shadow?: boolean; }): LayoutFrame | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
size | number | The native layout size identifier, measured in tiles across. |
options (省略可) | { mirror?: TileMirror | string; margin?: number; shadow?: boolean; } | Native game, SVG, sound or presentation options. |
戻り値
LayoutFrame | null
The drawn tile bounds plus margin, or null for an unsupported layout size.
例
import { layoutFrame } from "@johnmorrisdotca/jarajara/faces";
console.log(layoutFrame(4,{margin:10}));{ x: -10, y: -5, width: 145, height: 75 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。