本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · 写実的な絵柄

REALISTIC定数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

The realistic design: Knoll's 39 cards in a box 167.0869141 by 242.6669922, and Fomin's English pattern for every other card.

インポート

import { REALISTIC } from "@johnmorrisdotca/toranpu/card-faces/realistic";

定義

const REALISTIC: CardDesign

メンバー

名前型説明
namestring

The design's name, as cardFaceSvg and an element's design attribute take it.

boxreadonly [number, number]

The width and height each card is drawn in.

artReadonly<Record<string, string>>

Each card's drawing, by its id.

fallback (省略可)CardDesign | undefined

Where the set has no drawing for a card, the set that draws it instead; then plain.

draw (省略可)((card: string, context: { language: "en" | "ja"; }) => string | null) | undefined

Cards drawn by a function rather than from art: given a card's id and the language, the drawing (what goes inside an <svg> of box), or null where the set has no such card. Use it for a card whose words change with the language, or whose picture is worked out from its id, such as a territory card.

label (省略可)((card: string, language: "en" | "ja") => string | null | undefined) | undefined

What a screen reader says for a card of the set, in the language asked for; null or nothing for a card the set leaves to its usual name (a standard card), or to its id (any other).

frame (省略可)"paper" | "none" | undefined

How the card is framed. "paper" (unless said) draws the card's paper and edge under the art, as the standard cards have; "none" draws nothing under it, for art that fills the whole card and draws its own edge.

例

import { REALISTIC } from "@johnmorrisdotca/toranpu/card-faces/realistic";
console.log(REALISTIC.name);
realistic

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

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

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