mountRoller関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Put a dice tray into an element.
One model runs the whole tray: the roll is a pool of dice. Tapping a die
button adds one die of that kind to the pool; a chip in the pool takes one
away; the number row sets how many of the kind last touched. The dice the
tray opens with are a suggestion, not yet anybody's roll, so the first die
tapped takes their place: one tap gives a d20, and d20, d4, d4 gives
1d20+2d4. The notation box says the same pool in writing and can be typed
into for anything the buttons do not reach.
A tap on the felt throws the pool. Once plain dice have been thrown, a tap on a die holds it and the next throw rolls the rest.
インポート
import { mountRoller } from "@johnmorrisdotca/korokoro";
定義
function mountRoller(target: HTMLElement, options?: RollerOptions): RollerHandle
引数
| 名前 | 型 | 説明 |
|---|---|---|
target | HTMLElement | The HTMLElement that owns the native interface. |
options (省略可) | RollerOptions | Native settings and callbacks for this mounted interface. |
戻り値
RollerHandle
The native mounted handle, including controls and destroy() cleanup.
例
import { mountRoller } from "@johnmorrisdotca/korokoro";
const show = (host: HTMLElement, options: Parameters<typeof mountRoller>[1]) => mountRoller(host, options);
console.log(typeof show); // functionfunction出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。