CuboidPlayerOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How a cuboid player is set up: the solve, and how it is shown.
インポート
import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";
定義
type CuboidPlayerOptions = CuboidReplaySource & {
autoplay?: boolean;
loop?: boolean;
controls?: boolean;
speed?: number;
theme?: CubeTheme;
cloth?: Cloth;
readout?: boolean;
moveList?: boolean;
animateScrub?: boolean;
locale?: KyuubuLanguage;
onChange?: (status: ReplayStatus) => void;
onEnd?: () => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
dims | CuboidDims | The puzzle's width, height and depth. |
scramble | string | The scramble, as written. |
solution | string | The solve, as written. |
timeMs (省略可) | number | undefined | How long the solve took, in milliseconds, when that is known. |
stepMs (省略可) | readonly number[] | undefined | How long each step took, in milliseconds, when that is known; one for every step. |
autoplay (省略可) | boolean | undefined | Start playing as soon as it is drawn. |
loop (省略可) | boolean | undefined | Begin again when it ends. |
controls (省略可) | boolean | undefined | Show the controls: true unless said otherwise. A puzzle with none still plays when |
speed (省略可) | number | undefined | The speed it starts at: 1 is the solve's own pace. |
theme (省略可) | CubeTheme | undefined | The puzzle's colours. |
cloth (省略可) | "green" | "blue" | "red" | "black" | "wood" | undefined | The cloth the stage behind the puzzle is laid in: "green", "blue", "red", "black" or "wood", the family's five. With none, the stage is clear. |
readout (省略可) | boolean | undefined | Show the code of the move just made in large type, with what it turns in words, and say it to a screen reader as it changes. True unless said otherwise; with |
moveList (省略可) | boolean | undefined | Show the moves as buttons, the one just made marked and scrolled into view, each one taking the replay to it. True unless said otherwise; with |
animateScrub (省略可) | boolean | undefined | Whether moving the slider, or choosing a move, turns the puzzle between where it was and where it goes. True unless said otherwise. |
locale (省略可) | KyuubuLanguage | undefined | English or Japanese; the page's |
onChange (省略可) | ((status: ReplayStatus) => void) | undefined | Called after every step, and whenever it starts, stops or is moved. |
onEnd (省略可) | (() => void) | undefined | Called each time the end is reached. |
例
import type { CuboidPlayerOptions } from "@johnmorrisdotca/kyuubu/cuboid/play";
const value: CuboidPlayerOptions = { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false };
console.log(value.dims);[ 2, 3, 3 ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。