cuboidMoveForReleasefunction
The move a release makes: the picked layer turned by those quarters, or null for none.
Import it
import { cuboidMoveForRelease } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function cuboidMoveForRelease(pick: CuboidDragPick, quarters: number): CuboidMove | null
Parameters
| Name | Type | Description |
|---|---|---|
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. |
Returns
CuboidMove | null
The move a release makes: the picked layer turned by those quarters, or null for none.
Examples
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 }What it prints (run when this page was built)