本文へ移動

Toranpuトランプ

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

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

目次

リファレンス · カードの絵柄

CardFaceOptions型

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

How a face is drawn. Every field may be left out.

インポート

import type { CardFaceOptions } from "@johnmorrisdotca/toranpu/card-faces";

定義

type CardFaceOptions = {
    design?: "plain" | "four-colour" | CardDesign | (string & {});
    width?: number;
    title?: string;
    language?: Language;
};

メンバー

名前型説明
design (省略可)"plain" | "four-colour" | CardDesign | (string & {}) | undefined

"plain" (unless said), "four-colour", a design handed in, such as ENGLISH_PATTERN, or the name of a design the page has registered (registerCardDesign).

width (省略可)number | undefined

The width to draw at, in pixels; the height is 1.4 times it. Unless said, the drawing fills what holds it.

title (省略可)string | undefined

What a screen reader says. Unless said, the card's name in language, "queen of spades". An empty string makes it decoration.

language (省略可)Language | undefined

The language of the card's name, and of a joker's corner word: "en" (unless said) or "ja".

例

import type { CardFaceOptions } from "@johnmorrisdotca/toranpu/card-faces";

const value: CardFaceOptions = { design: "four-colour", width: 80, language: "ja" };
console.log(value.design);
four-colour

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

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

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