DragHint型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
What to drag to make a turn of one layer, or of several about one axis as one (a wide turn).
インポート
import type { DragHint } from "@johnmorrisdotca/kyuubu";
定義
type DragHint = {
axis: CubeAxis;
layers: number[];
turns: CubeTurns;
seam: boolean;
slots: number[];
face: CubeFace | null;
grab: number | null;
drag: [
number,
number
] | null;
quarters: 1 | -1 | 2;
atOnce: boolean;
arrow: HintArrow | null;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
axis | CubeAxis | The turn's axis. |
layers | number[] | The layers that turn, counted from the axis's negative side. |
turns | CubeTurns | How far, by the right-hand rule. |
seam | boolean | Whether the turn is of two neighbouring layers on a cube of 3 or more: one drag that begins on the seam between them, at the tail of the arrow, or two fingers at once, turns both together. |
slots | number[] | Every sticker those layers carry, as indexes into the state: the stickers to light. |
face | "U" | "R" | "F" | "D" | "L" | "B" | null | The face the arrow lies on, or null where no side of the layer can be seen well enough from here: look round the cube first. |
grab | number | null | The sticker to take hold of, at the arrow's tail, in the first of the layers; null with |
drag | [number, number] | null | The way to drag across the screen (x right, y down), as a unit vector; null with |
quarters | 1 | -1 | 2 | What a drag along the arrow makes, as |
atOnce | boolean | Whether the layer is picked as soon as the drag begins ( |
arrow | HintArrow | null | The arrow to draw; null with |
例
import type { DragHint } from "@johnmorrisdotca/kyuubu";
import { dragHint, parseMove, viewMatrix } from "@johnmorrisdotca/kyuubu";
const value: DragHint = dragHint(parseMove("R", 3)!, 3, viewMatrix(-30, -20))!;
console.log(value.layers);[ 2 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。