本文へ移動

Meikyuu迷宮

シード付きの迷路と矢印パズルを作り、番号付きの問題を進め、平面や立体表面で遊べます。

「迷宮」は迷路のように入り組んだ場所を表す言葉です。 名前について(英語)

目次

リファレンス

遊べる盤

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.

ソースを見るGitHub で編集@johnmorrisdotca/meikyuu 3.2.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。