keepScrambling関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Keep a cube turning. Starts at once unless autoplay is false.
インポート
import { keepScrambling } from "@johnmorrisdotca/kyuubu";
定義
function keepScrambling(cube: Scrambled, options?: KeepScramblingOptions): KeepScramblingHandle
引数
| 名前 | 型 | 説明 |
|---|---|---|
cube | Scrambled | The cube whose state or turning is controlled. |
options (省略可) | KeepScramblingOptions | Options for this call; omitted fields retain their documented defaults. |
戻り値
KeepScramblingHandle
Keep a cube turning. Starts at once unless autoplay is false.
例
import { CubeView, keepScrambling } from "@johnmorrisdotca/kyuubu";
const host = document.createElement("div");
host.style.cssText = "width:160px;height:160px;position:relative";
document.body.append(host);
const cube = new CubeView(host, { size: 3 });
const turning = keepScrambling(cube, { autoplay: false, pace: "slow" });
console.log(turning.running);
// turning.start() begins; turning.destroy() and cube.destroy() clean up.この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。