MeikyuuMountOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Native puzzle/level/recipe, display, controls, sound, stones and event callbacks for a flat player.
インポート
import type { MeikyuuMountOptions } from "@johnmorrisdotca/meikyuu/play";
定義
type MeikyuuMountOptions = MazeLook & {
kind?: MeikyuuKind;
level?: number;
recipe?: string | MazeRecipe | ArrowRecipe | MixedRecipe;
tap?: boolean;
hints?: boolean;
banner?: boolean;
controls?: boolean;
zoom?: boolean;
ratio?: "square" | "maze" | number;
orientation?: MeikyuuOrientation;
gutter?: number;
reserve?: number;
fit?: FitMode;
edgePan?: boolean;
pan?: boolean;
turnButton?: boolean;
sound?: boolean;
stones?: StoneOption;
language?: MeikyuuLanguage;
onMove?: (detail: MeikyuuEventDetail) => void;
onSolve?: (detail: MeikyuuEventDetail) => void;
onKey?: (detail: MeikyuuEventDetail) => void;
onUnlock?: (detail: MeikyuuEventDetail) => void;
onBump?: (detail: MeikyuuEventDetail) => void;
onLose?: (detail: MeikyuuEventDetail) => void;
onStones?: (detail: MeikyuuEventDetail) => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
board (省略可) | MeikyuuBoardLook | "paper" | "wood" | "green" | "blue" | "red" | "black" | undefined | A board by name, or its colours. |
trail (省略可) | "green" | "blue" | "red" | "violet" | "orange" | (string & {}) | undefined | The line's colour: one of the named ones, or any CSS colour. |
wall (省略可) | number | undefined | The thickness of a wall, in cells. Default 0.12. |
line (省略可) | number | undefined | The thickness of the line, in cells. Default 0.34. |
kind (省略可) | "maze" | "arrows" | "mixed" | undefined | Which list the level is from. Default |
level (省略可) | number | undefined | A level of the package's own lists, from 1. |
recipe (省略可) | string | MazeRecipe | ArrowRecipe | MixedRecipe | undefined | A recipe of your own, as its code or as an object, instead of a level. |
tap (省略可) | boolean | undefined | A tap runs the line along the corridor to the next fork. Default false. |
hints (省略可) | boolean | undefined | Offer the Hint button. Default true. |
banner (省略可) | boolean | undefined | Show the message over the board when the puzzle is solved ("Solved in 3 strokes."); a tap on it, its close button or Escape puts it away. False for none (the line of words under the board still says so). Default true. |
controls (省略可) | boolean | undefined | The buttons and the lines of words under the board. Default true. |
zoom (省略可) | boolean | undefined | The zoom pad. Default true. (The wheel and the pinch always work.) |
ratio (省略可) | number | "maze" | "square" | undefined | The shape of the box, width over height as the maze was made: |
orientation (省略可) | "portrait" | "landscape" | "auto" | undefined | Which way up the maze is shown: |
gutter (省略可) | number | undefined | The page left beside the box on each side, in pixels, at least. Default 24 ( |
reserve (省略可) | number | undefined | What the window holds besides the box, in pixels. Default 200 ( |
fit (省略可) | "both" | "width" | "height" | undefined | What Fit shows: the whole maze ( |
edgePan (省略可) | boolean | undefined | A line drawn to the edge of a zoomed box moves the view along. Default true. |
pan (省略可) | boolean | undefined | Start with every one-finger drag moving the view, not drawing (the Move button toggles it). Default false. |
turnButton (省略可) | boolean | undefined | Show a Turn button in the pad, for a maze that is not square. Default false. |
sound (省略可) | boolean | undefined | Make a sound for each thing that happens. Default false. |
stones (省略可) | StoneOption | undefined | Stones for mazes: |
language (省略可) | MeikyuuLanguage | undefined | The language the words are in. Left out, the host's own |
onMove (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onSolve (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onKey (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onUnlock (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onBump (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onLose (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | |
onStones (省略可) | ((detail: MeikyuuEventDetail) => void) | undefined | A stone was laid or taken up, or the stones were cleared, restarted or undone. |
例
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import type { MeikyuuMountOptions } from "@johnmorrisdotca/meikyuu/play";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const value: MeikyuuMountOptions = {kind:"maze",recipe,language:"en"};
console.log(value);{
kind: 'maze',
recipe: {
shape: 'square',
w: 5,
h: 5,
algorithm: 'backtracker',
mode: 'to-goal',
seed: 42
},
language: 'en'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。