PlayerOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
How a player is set up: the solve, and how it is shown.
インポート
import type { PlayerOptions } from "@johnmorrisdotca/kyuubu/player";
定義
type PlayerOptions = ReplaySource & {
autoplay?: boolean;
loop?: boolean;
controls?: boolean;
speed?: number;
theme?: CubeTheme;
cloth?: Cloth;
guide?: boolean;
readout?: boolean;
moveList?: boolean;
animateScrub?: boolean;
locale?: KyuubuLanguage;
onChange?: (status: ReplayStatus) => void;
onEnd?: () => void;
};
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
size (省略可) | number | undefined | The cube's side: 3 when left out. |
scramble | string | The scramble, as written. |
solution | string | The solve, as written; comments and brackets are skipped. |
timeMs (省略可) | number | undefined | How long the solve took, in milliseconds, when that is known. |
stepMs (省略可) | readonly number[] | undefined | How long each step of the solution 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 cube with none still plays when |
speed (省略可) | number | undefined | The speed it starts at: 1 is the solve's own pace. |
theme (省略可) | CubeTheme | undefined | The cube's colours. |
cloth (省略可) | "green" | "blue" | "red" | "black" | "wood" | undefined | The cloth the stage behind the cube is laid in: "green", "blue", "red", "black" or "wood", the family's five. With none, the stage is clear. |
guide (省略可) | boolean | undefined | Start with the cube for the viewer to turn themselves, the solve's next move shown on it, rather than played for them. |
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 cube between where it was and where it goes: forwards going on, each turn undone going back, a long jump catching up at once. 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 { PlayerOptions } from "@johnmorrisdotca/kyuubu/player";
const value: PlayerOptions = { size: 3, scramble: "R", solution: "R'", autoplay: false };
console.log(value.size);3出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。