handLayout関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where each card of a hand of count lies: a fan when open, a squared-up
stack with a sliver of each card showing when closed, and every shape in
between. The middle card turns least; the first lies at x 0.
インポート
import { handLayout } from "@johnmorrisdotca/toranpu/element";
ほかのエクスポート元: @johnmorrisdotca/toranpu/element/define
定義
function handLayout(count: number, options?: HandLayoutOptions): CardPlace[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
count | number | The requested number of cards, sounds or layout positions. |
options (省略可) | HandLayoutOptions | Options for this call; omitted fields retain their documented defaults. |
戻り値
CardPlace[]
Where each card of a hand of count lies: a fan when open, a squared-up stack with a sliver of each card showing when closed, and every shape in between. The middle card turns least; the first lies at x 0.
例
import { handLayout } from "@johnmorrisdotca/toranpu/element";
console.log(handLayout(3, { open: 1 }));[
{ x: 0, y: 0.06, rotate: -4 },
{ x: 0.42, y: 0, rotate: 0 },
{ x: 0.84, y: 0.06, rotate: 4 }
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。