リファレンス
遊べる盤
import { … } from "@johnmorrisdotca/meikyuu/play";
最小化と gzip 圧縮をしたサイズは 50.2 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Meikyuu, played in a page: mountMeikyuu draws a maze, an arrow puzzle or a mixed one into any element and
plays it by touch and mouse, with zoom and pan for big mazes, page left beside the board to scroll by, a tall maze that lies down on a wide screen, Undo, Restart, Hint, a celebration that respects
prefers-reduced-motion, optional sounds, and the words in English and Japanese. A separate entry
(@johnmorrisdotca/meikyuu/play), so a server never loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
createMeikyuuSounds | 関数 | Create the optional synthesized native sound player; sound playback is requested by host actions. |
EDGE | 定数 | How near an edge of the box a line's end must be dragged to move the view, and the most the view moves in a frame there, in pixels. |
EDGE_STEP | 定数 | The native viewport edge-pan step in pixels. |
edgeNudge | 関数 | How far to move the view in a frame for a finger at (px, py) of a box: the board moves the other way, toward the finger. |
ensureMeikyuuPlayStyle | 関数 | Put the style in the page once: in the document's head, or in the shadow root the host is in. |
FIT_MODES | 定数 | What a fit makes visible: both the whole board (default); width the board as wide as the box, which for a board taller than the box is the top of it with the rest to move down to; height the board as tall as the box, the left of it for a board wider than the box. |
FitMode | 型 | Fit both dimensions, only the width, or only the height of a board. |
fitView | 関数 | The view that shows the board as a mode says, with a margin of pad cells: centred where it fits, and at the top or left where it does not. |
isFitted | 関数 | Whether the view is the board fitted, as the mode says. |
keptView | 関数 | A view kept where some of the board can be seen: its middle never leaves the area (with a margin). |
MEIKYUU_GUTTER | 定数 | The page left beside the box, in pixels: the least, and the most the zoom-out widens it to. |
MEIKYUU_GUTTER_MAX | 定数 | The maximum native viewport gutter in pixels. |
MEIKYUU_ORIENTATIONS | 定数 | WHICH WAY UP A MAZE IS LOOKED AT. |
MEIKYUU_PLAY_STYLE | 定数 | THE STYLE a playable Meikyuu board wears (mountMeikyuu, <meikyuu-board>): the drawing's own (MEIKYUU_STYLE) and the board's box, its buttons, its lines of words and its tabs. |
MEIKYUU_RESERVE | 定数 | What a window is assumed to hold besides the box, in pixels: the page's header, and the board's buttons and lines of words. |
MEIKYUU_SOUND_KINDS | 定数 | THE SOUNDS, made in the browser: short tones from the Web Audio API, one for each thing that happens (a step, drawing back, a key, an arrow bumping, an arrow flying off, an unlock, a solve, a loss). |
MeikyuuEventDetail | 型 | What every event tells of the board. |
MeikyuuMount | 型 | The mounted flat maze, arrow or mixed board, its game/actions, view and cleanup handle. |
MeikyuuMountOptions | 型 | Native puzzle/level/recipe, display, controls, sound, stones and event callbacks for a flat player. |
MeikyuuOrientation | 型 | The native portrait, landscape or automatic board orientation. |
MeikyuuPuzzle | 型 | What is being played. |
MeikyuuSoundKind | 型 | One native synthesized board sound. |
MeikyuuSounds | 型 | Native synthesized sound playback and cleanup methods. |
MOST_CELL_PIXELS | 定数 | The scales a view may have: the whole board fitted, to a cell this many pixels wide (at least a bit past the fit, so a small maze can still zoom). |
mountMeikyuu | 関数 | Draw a puzzle into host and play it. |
pannedBy | 関数 | The view moved so that the board slides by (dx, dy) pixels under the box. |
pointAt | 関数 | The point of the board under a pixel of the box. |
puzzleOf | 関数 | The puzzle a set of options names: a level of the package's lists, or a recipe given, or null. |
scaleLimits | 関数 | Read the minimum and maximum view scale for this viewport and gutter. |
View | 型 | A BOARD LOOKED AT THROUGH A BOX, which may be zoomed in until a cell is as big as a thumb and moved about: the arithmetic of the view, without a page. |
ViewBox | 型 | How a box of width by height pixels shows a board: the margin round it in cells, and how far in a view may go. |
viewBoxOf | 関数 | The text of the viewBox attribute that shows the view. |
visibleArea | 関数 | The part of the board the view shows. |
zoomedAbout | 関数 | The view zoomed by factor about the pixel (px, py) of the box, which stays over the same spot of the board. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。