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