partedHandLayout関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A HAND PARTED AT ONE CARD: that card lifted a little, upright and wholly in view, and the cards to
its left and right drawn apart from it into a group on each side (one group where it is the first or
the last). The groups close up to make room, down to a sliver of each card, so the hand keeps the room
its fan takes wherever it can; a hand too short to close up that far takes a little more. Built on the
open fan of handLayout, its dip and turn kept for every card but the one parted. Where at is no card
of the hand, the fan itself.
partedHandLayout(7, 3); // three cards squared up on the left, the fourth lifted clear, three on the rightインポート
import { partedHandLayout } from "@johnmorrisdotca/toranpu/element";
ほかのエクスポート元: @johnmorrisdotca/toranpu/element/define
定義
function partedHandLayout(count: number, at: number, options?: HandLayoutOptions & PartOptions): CardPlace[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
count | number | The requested number of cards, sounds or layout positions. |
at | number | The zero-based split or card position. |
options (省略可) | HandLayoutOptions & PartOptions | Options for this call; omitted fields retain their documented defaults. |
戻り値
CardPlace[]
A HAND PARTED AT ONE CARD: that card lifted a little, upright and wholly in view, and the cards to its left and right drawn apart from it into a group on each side (one group where it is the first or the last). The groups close up to make room, down to a sliver of each card, so the hand keeps the room its fan takes wherever it can; a hand too short to close up that far takes a little more. Built on the open fan of handLayout, its dip and turn kept for every card but the one parted. Where at is no card of the hand, the fan itself. ts partedHandLayout(7, 3); // three cards squared up on the left, the fourth lifted clear, three on the right
例
import { partedHandLayout } from "@johnmorrisdotca/toranpu/element";
console.log(partedHandLayout(3, 1, { gap: 30 }));[
{ x: 0, y: 0.06, rotate: -4 },
{ x: 31, y: -0.2, rotate: 0 },
{ x: 62, y: 0.06, rotate: 4 }
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。