DrawMazeOptionstype
Native maze appearance, current trail, collected keys, stones, hints, label and SVG presentation choices.
Import it
import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";
Definition
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;
};
Members
| Name | Type | Description |
|---|---|---|
board (optional) | MeikyuuBoardLook | "paper" | "wood" | "green" | "blue" | "red" | "black" | undefined | A board by name, or its colours. |
trail (optional) | "green" | "blue" | "red" | "violet" | "orange" | (string & {}) | undefined | The line's colour: one of the named ones, or any CSS colour. |
wall (optional) | number | undefined | The thickness of a wall, in cells. Default 0.12. |
line (optional) | number | undefined | The thickness of the line, in cells. Default 0.34. |
path (optional) | readonly number[] | undefined | The line drawn so far, as cells from the start. |
collected (optional) | readonly number[] | undefined | The keys picked up. |
stones (optional) | readonly number[] | undefined | The cells with a stone on them (see stones.ts). |
solution (optional) | boolean | undefined | Draw the one way from the start to the goal. |
hint (optional) | { back?: number; cells: readonly number[]; } | undefined | Cells to light as a hint, and how many cells of the line to draw back first. |
won (optional) | boolean | undefined | Whether the maze is solved, which gives the line its colour of a win. |
language (optional) | MeikyuuLanguage | undefined | |
label (optional) | string | undefined | The drawing's own words for a screen reader. |
standalone (optional) | boolean | undefined | Put the style in the drawing, so it is a picture on its own. |
pad (optional) | number | undefined | The margin round the shape, in cells. Default 0.6. |
orientation (optional) | "portrait" | "landscape" | "auto" | undefined | Which way up the picture is: |
Examples
import type { DrawMazeOptions } from "@johnmorrisdotca/meikyuu/draw";
const value: DrawMazeOptions = {label:"Sample maze",solution:true};
console.log(value);{ label: 'Sample maze', solution: true }What it prints (run when this page was built)