mountCuboidPlayer関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A solve on a cuboid drawn in an element, with its controls.
インポート
import { mountCuboidPlayer } from "@johnmorrisdotca/kyuubu/cuboid/play";
定義
function mountCuboidPlayer(host: HTMLElement, options: CuboidPlayerOptions): CuboidPlayerHandle
引数
| 名前 | 型 | 説明 |
|---|---|---|
host | HTMLElement | The DOM element that receives the view and controls. |
options | CuboidPlayerOptions | Options for this call; omitted fields retain their documented defaults. |
戻り値
CuboidPlayerHandle
A solve on a cuboid drawn in an element, with its controls.
例
import { mountCuboidPlayer } from "@johnmorrisdotca/kyuubu/cuboid/play";
const host = document.createElement("div");
document.body.append(host);
const player = mountCuboidPlayer(host, { dims: [2, 3, 3], scramble: "R", solution: "R'", autoplay: false });
console.log(player.plan?.solved);
// Call player.destroy() when removing the player.この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。