リファレンス
遊べる盤
import { … } from "@johnmorrisdotca/tsunagi/play";
最小化と gzip 圧縮をしたサイズは 24.7 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Tsunagi, played in a page: mountTsunagi draws a level into any element and
plays it by touch and mouse, with Undo, Restart, Check and Cheat, the zoom
pad for big boards, and the words in English and Japanese. A separate entry
(@johnmorrisdotca/tsunagi/play), so a server never loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
edgeNudge | 関数 | How far to move a zoomed view in a frame, for a finger at (x, y) in a box: toward the edge it is near, or not at all. |
ensureTsunagiPlayStyle | 関数 | Put the style in the page once: in the document's head, or in the shadow root the host is in. |
keptView | 関数 | A view kept inside the board: never a gap between the board's edge and the box's. |
mountTsunagi | 関数 | Draw a level into host and play it. |
TSUNAGI_EDGE | 定数 | How near an edge of the box a line's end must be dragged to move the view, and how far each frame moves it, in pixels. |
TSUNAGI_EDGE_STEP | 定数 | The native pixel increment for nudging the view near an edge. |
TSUNAGI_FITTED | 定数 | The whole board, fitted. |
TSUNAGI_MOST_ZOOM | 定数 | How far a board may be zoomed in, as a multiple of the whole board fitted to its box. |
TSUNAGI_PLAY_STYLE | 定数 | THE STYLE a playable Tsunagi board wears (mountTsunagi, <tsunagi-board>): the drawing's own (TSUNAGI_STYLE) and the board's box, its buttons, its lines of words and its zoom pad. |
TSUNAGI_ZOOM_FROM | 定数 | The smallest board a player is given the pad for. |
TsunagiEventDetail | 型 | What a mounted board tells of itself in every event. |
TsunagiLook | 型 | What a board looks like: every option drawTsunagi takes that does not depend on the lines. |
TsunagiMount | 型 | The mounted native board handle and its game, display, action and cleanup methods. |
TsunagiMountOptions | 型 | The puzzle, native display choices, controls and event callbacks for mounting a board. |
TsunagiView | 型 | A BIG BOARD LOOKED AT THROUGH A BOX: from 10×10 up, a phone's cells are smaller than a thumb, so the board is drawn up to three times the box's width and looked at through it, zoomed and moved by a pad of buttons, the wheel and (while a line is dragged) the box's edge, never by scrolling the page. |
zoomedAbout | 関数 | A view zoomed by factor about the point (px, py) of the box, which stays over the same spot of the board. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。