リファレンス
SVG盤面と表記
import { … } from "@johnmorrisdotca/sugoroku/draw";
最小化と gzip 圧縮をしたサイズは 5.2 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Sugoroku's drawing: SVG text for a board with its checkers, dice and cube, the
style that makes it a board, and the colours it is made of. A separate entry
(@johnmorrisdotca/sugoroku/draw), so a server that only checks a game never
loads any of it.
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
BoardLayout | クラス | The layout of a board, a function of its options: where each point, the bar, each tray, the rail and the dice sit, all in landscape units. |
BoardOptions | 型 | The cube, viewing side, home direction and orientation used to calculate board geometry. |
boardSize | 関数 | The width and height the board is drawn in, which is the other way about when it stands up. |
Box | 型 | A box: where something is, in landscape units before any turning. |
colourProperty | 関数 | The custom property a colour is set on. |
colourStyle | 関数 | The inline custom properties of a drawing: the named board and checkers, then any colour given. |
drawSugoroku | 関数 | The board as SVG text for position. |
MOST_DRAWN | 定数 | How many checkers are drawn on a stack before the last one carries the count. |
Orientation | 型 | Whether the board lies across the page or stands up in it. |
SUGOROKU_BOARD_NAMES | 定数 | The names of the boards. |
SUGOROKU_BOARDS | 定数 | The boards the drawing knows by name, set against any theme. |
SUGOROKU_CHECKER_SET_NAMES | 定数 | The names of the checker sets. |
SUGOROKU_CHECKER_SETS | 定数 | The checkers the drawing knows by name. |
SUGOROKU_COLOUR_NAMES | 定数 | The names of the colours, as the custom properties spell them (--sg- and the name in kebab case). |
SUGOROKU_STYLE | 定数 | THE STYLE a Sugoroku board is drawn with: colours as custom properties (--sg-felt, --sg-white and the rest of SugorokuColours), light by default and dark when the device is, and the one rule that matters for a game played with fingers and a mouse: nothing on the board can be selected, dragged or double-tapped. |
SugorokuBoardName | 型 | A named board, a set of colours for the board and its points. |
SugorokuCheckerSetName | 型 | A named pair of checker colours. |
SugorokuColours | 型 | THE COLOURS OF A BOARD. |
SugorokuDrawOptions | 型 | What to draw with. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。