createRollSound関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The tray's sound for one window. load fetches the recordings; it is the
package's own lazy import unless a test hands in another.
インポート
import { createRollSound } from "@johnmorrisdotca/korokoro";
定義
function createRollSound(win: AudioWindow | undefined, load?: () => Promise<{ SOUNDS: SoundData; }>): RollSound
引数
| 名前 | 型 | 説明 |
|---|---|---|
win | AudioWindow | undefined | An audio-capable window, or undefined for a silent host. |
load (省略可) | () => Promise<{ SOUNDS: SoundData; }> | A lazy loader for the recorded sounds. |
戻り値
RollSound
The tray's sound for one window. load fetches the recordings; it is the package's own lazy import unless a test hands in another.
例
import { createRollSound } from "@johnmorrisdotca/korokoro";
const sound = createRollSound(undefined);
sound.play({ dice: 2, ms: 0, landings: [0, 0] });
sound.close();
console.log(typeof sound.play);function出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。