KarakuriElementOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Full native host options; attributes take priority over starting choices.
インポート
import type { KarakuriElementOptions } from "@johnmorrisdotca/karakuri/element";
ほかのエクスポート元: @johnmorrisdotca/karakuri/element/define
定義
type KarakuriElementOptions = Partial<MountOptions>;
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
game (省略可) | "save-the-character" | "pin-rescue" | "nuts-and-bolts" | "stretch-grabber" | "grid-escape" | "rope-cut" | "tube-sort" | "choice-story" | undefined | |
controller (省略可) | Controller | undefined | A matching host-owned controller, for preserving an existing position. |
keyboard (省略可) | boolean | undefined | Allow a focused canvas to use the keyboard. Default true. |
keyboardStep (省略可) | number | undefined | Arrow movement in game units; Shift always moves one unit. Default 10. |
level (省略可) | number | undefined | The level to start on, from 1. |
lang (省略可) | KarakuriLanguage | undefined |
|
ui (省略可) | "full" | "board" | undefined |
|
room (省略可) | (() => number) | undefined | The most height, in pixels, the board may take now. A page that puts something above or under the board says how much room is left
(it is asked again whenever the board is fitted: on a resize, and when the box it sits in changes size). By default most of the
window: 82% of its height, less 120 pixels for the bar and buttons when |
clock (省略可) | "real" | "manual" | undefined |
|
onStatus (省略可) | ((event: StatusEvent) => void) | undefined | Called whenever the level's status changes (and once at the start, as |
onChange (省略可) | ((event: StatusEvent) => void) | undefined | Called after each move, release or step that changed what is shown (the bar's line included). |
例
import type { KarakuriElementOptions } from "@johnmorrisdotca/karakuri/element";
const options: KarakuriElementOptions = { game: "tube-sort", keyboardStep: 10 };
console.log(options.game);tube-sort出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。