本文へ移動

Jarajaraジャラジャラ

麻雀牌を描き、手牌や積み重ねた盤を配置し、シード付きの「合わせ」をひとりでも対戦卓でも遊べます。

「ジャラジャラ」は麻雀牌が触れ合う音を表す言葉です。 名前について(英語)

目次

リファレンス · 音の操作

TileSounds型

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

A table's sounds: play one, mute and unmute, change the volume, close when the table goes.

インポート

import type { TileSounds } from "@johnmorrisdotca/jarajara/tile-sounds";

定義

type TileSounds = {
    play(kind: TileSoundKind, options?: PlayTileSoundOptions): void;
    load(): Promise<boolean>;
    readonly muted: boolean;
    setMuted(muted: boolean): void;
    volume: number;
    close(): void;
};

メンバー

名前型説明
play(kind: TileSoundKind, options?: PlayTileSoundOptions): void

Play a sound, or several of one kind in a row; nothing while muted or closed.

load(): Promise<boolean>

Fetch and decode the recordings now, rather than at the first sound. True once they are ready; false where they cannot be had.

mutedboolean

Whether it is muted.

setMuted(muted: boolean): void

Mute or unmute. Muting stops nothing already playing; it only keeps anything new from starting.

volumenumber

How loud, from 0 to 1.

close(): void

Stop for good, and let the audio context go.

例

import type { TileSounds } from "@johnmorrisdotca/jarajara/tile-sounds";
import { createTileSounds } from "@johnmorrisdotca/jarajara/tile-sounds";

const value: TileSounds = createTileSounds({muted:true,window:null});
console.log(value.muted);
value.close();
true

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

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

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