pileLayout関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Where each card of a pile of count lies, bottom first, the top card last:
at 0 messiness a neat stack whose edge shows a card's thickness for each
card under the top, and towards 1 a heap, each card nudged and turned a
little more. Seeded, so the same pile always looks the same, and adding a
card on top moves none of those under it. Only the top depth cards under
the top one are given places; a pile is never drawn deeper than that.
インポート
import { pileLayout } from "@johnmorrisdotca/toranpu/element";
ほかのエクスポート元: @johnmorrisdotca/toranpu/element/define
定義
function pileLayout(count: number, options?: PileLayoutOptions): CardPlace[]
引数
| 名前 | 型 | 説明 |
|---|---|---|
count | number | The requested number of cards, sounds or layout positions. |
options (省略可) | PileLayoutOptions | Options for this call; omitted fields retain their documented defaults. |
戻り値
CardPlace[]
Where each card of a pile of count lies, bottom first, the top card last: at 0 messiness a neat stack whose edge shows a card's thickness for each card under the top, and towards 1 a heap, each card nudged and turned a little more. Seeded, so the same pile always looks the same, and adding a card on top moves none of those under it. Only the top depth cards under the top one are given places; a pile is never drawn deeper than that.
例
import { pileLayout } from "@johnmorrisdotca/toranpu/element";
console.log(pileLayout(3, { seed: 42, messiness: 0.5 }));[
{ x: 0.001, y: 0.02, rotate: 5.071 },
{ x: 0.029, y: -0.004, rotate: -1.936 },
{ x: 0.026, y: -0.006, rotate: 3.17 }
]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。