DrawMazeOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Native maze appearance, current trail, collected keys, stones, hints, label and SVG presentation choices.
インポート
import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";
定義
type DrawMazeOptions = MazeLook & {
path?: readonly number[];
collected?: readonly number[];
stones?: readonly number[];
solution?: boolean;
hint?: {
back?: number;
cells: readonly number[];
};
won?: boolean;
language?: MeikyuuLanguage;
label?: string;
standalone?: boolean;
pad?: number;
orientation?: MeikyuuOrientation;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
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. |
path (省略可) | readonly number[] | undefined | The line drawn so far, as cells from the start. |
collected (省略可) | readonly number[] | undefined | The keys picked up. |
stones (省略可) | readonly number[] | undefined | The cells with a stone on them (see stones.ts). |
solution (省略可) | boolean | undefined | Draw the one way from the start to the goal. |
hint (省略可) | { back?: number; cells: readonly number[]; } | undefined | Cells to light as a hint, and how many cells of the line to draw back first. |
won (省略可) | boolean | undefined | Whether the maze is solved, which gives the line its colour of a win. |
language (省略可) | MeikyuuLanguage | undefined | |
label (省略可) | string | undefined | The drawing's own words for a screen reader. |
standalone (省略可) | boolean | undefined | Put the style in the drawing, so it is a picture on its own. |
pad (省略可) | number | undefined | The margin round the shape, in cells. Default 0.6. |
orientation (省略可) | "portrait" | "landscape" | "auto" | undefined | Which way up the picture is: |
例
import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";
const value: DrawMazeOptions = {label:"Sample maze",solution:true};
console.log(value);{ label: 'Sample maze', solution: true }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。