リファレンス
遊べる盤面
import { … } from "@johnmorrisdotca/sugoroku/play";
最小化と gzip 圧縮をしたサイズは 20.3 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Sugoroku, played in a page: mountSugoroku draws a game into any element and
plays it by touch and mouse, with the doubling cube, Undo, the computer for
either side or both, optional sounds, and the words in English and Japanese. A
separate entry (@johnmorrisdotca/sugoroku/play), so a server never loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
createSounds | 関数 | A player for the sounds, which makes its audio only when first asked to play, as browsers insist on a gesture first. |
ensureSugorokuPlayStyle | 関数 | Put the style in the page once: in the document's head, or in the shadow root the host is in. |
mountSugoroku | 関数 | Mount a board into host. |
packagedSounds | 関数 | The sounds' addresses beside the package's code, or an empty set where import.meta.url is not an address (some test runners). |
SoundName | 型 | THE SOUNDS OF A BOARD, optional: a checker set down, a checker hit, the dice and the cube. |
SoundPlayer | 型 | Optional board-sound playback and cleanup methods. |
SoundUrls | 型 | The address of each sound. |
SUGOROKU_PLAY_STYLE | 定数 | THE STYLE a playable Sugoroku board wears (mountSugoroku, <sugoroku-board>): the drawing's own (SUGOROKU_STYLE), the board's box, its buttons and its lines of words. |
SUGOROKU_STRINGS | 定数 | The native English and Japanese labels, announcements and interpolation templates. |
SugorokuEventDetail | 型 | What every event of the board carries. |
SugorokuLanguage | 型 | THE WORDS A SUGOROKU BOARD SAYS, in English and Japanese: the buttons, the line that says whose turn it is and what to do, and the result of a game. |
sugorokuLanguageOf | 関数 | The language an element or its page is in: its own lang, or the nearest above, and English unless that begins with ja. |
SugorokuLook | 型 | How the board looks, apart from the game. |
SugorokuMount | 型 | The mounted native board, current game/match/record, actions and cleanup handle. |
SugorokuMountOptions | 型 | Native variant, rules, seed, computer, display, control, sound and event-callback choices. |
sugorokuSay | 関数 | A line in a language with its {name}s filled in. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。