cuboidMoveForRelease関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The move a release makes: the picked layer turned by those quarters, or null for none.
インポート
import { cuboidMoveForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
定義
function cuboidMoveForRelease(pick: CuboidDragPick, quarters: number): CuboidMove | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
pick | CuboidDragPick | The layer and screen direction selected by a drag. |
quarters | number | The signed number of quarter turns on release; 0 cancels the move. |
戻り値
CuboidMove | null
The move a release makes: the picked layer turned by those quarters, or null for none.
例
import { cuboidMoveForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
const cpick = { axis: 1 as const, layer: 0, along: [1, 0] as [number, number], halfOnly: true };
console.log(cuboidMoveForRelease(cpick, 2));{ axis: 1, layer: 0, turns: 2 }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。