本文へ移動

Toranpuトランプ

デッキを使い、11種類のゲームでコンピューターと対戦し、ソリティアを解いたり、独自の絵柄でカードを表示したりできます。

「トランプ」は、日本語で playing cards を指す言葉です。 名前について(英語)

目次

リファレンス · カード・手札・山札

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[]

引数

名前型説明
countnumber

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 }
]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/toranpu 2.15.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。