本文へ移動

Toranpuトランプ

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

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

目次

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

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

引数

名前型説明
countnumber

The requested number of cards, sounds or layout positions.

atnumber

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

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

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

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