Type Alias: DieOptions
type DieOptions = object;Defined in: src/ui/die.ts:32
What a lone die is told when it is made. Everything may be left out.
Properties
sides?
optional sides?: Sides;Defined in: src/ui/die.ts:34
The kind of die: 2 to 1000 sides, or "F" for a Fate die. 6 when left out.
faces?
optional faces?: CustomFace[];Defined in: src/ui/die.ts:36
A die of your own: its faces, in order, in place of numbers. sides is then their count.
face?
optional face?: number;Defined in: src/ui/die.ts:38
The face showing at first, from 1 (from −1 for a Fate die). Left out, the highest face of the die, or a 6 on a d6.
rollable?
optional rollable?: boolean;Defined in: src/ui/die.ts:40
Whether a tap rolls it: true when left out. False is a die that only shows a face.
size?
optional size?: DieSize;Defined in: src/ui/die.ts:42
small, medium (unless said) or large. width wins.
width?
optional width?: number;Defined in: src/ui/die.ts:44
Its width in pixels, in place of size.
onePip?
optional onePip?: "red" | "black";Defined in: src/ui/die.ts:46
The colour of a d6's one pip: "red" (unless said) or "black".
cloth?
optional cloth?: Cloth;Defined in: src/ui/die.ts:48
A cloth's name, for the page's own colours to follow the tray's: only the ink and the die's edge on a felt. theme is laid over it.
theme?
optional theme?: Record<`--kk-${string}`, string>;Defined in: src/ui/die.ts:50
CSS variables for the die, such as { "--kk-die": "#fff" }.
locale?
optional locale?: string;Defined in: src/ui/die.ts:52
"ja…" for Japanese, anything else English. The page's own language when left out.
strings?
optional strings?: Partial<RollerStrings>;Defined in: src/ui/die.ts:54
Words to use instead of the built-in ones.
source?
optional source?: RandomSource;Defined in: src/ui/die.ts:56
Where the throw comes from: seededSource("table") makes the same throws for everyone. Cryptographic when left out.
animationMs?
optional animationMs?: number;Defined in: src/ui/die.ts:58
The length of the tumble in milliseconds: 600 when left out. Reduced motion always skips it.
sound?
optional sound?: boolean;Defined in: src/ui/die.ts:60
Whether a throw makes the sound of dice. Off when left out, because a die on its own is a thing on somebody's page, and a page that has not asked for noise gets none.
playSound?
optional playSound?: PlaySound;Defined in: src/ui/die.ts:62
A sound of your own for each throw, in place of the recorded dice. Used only when sound is true.
onRoll?
optional onRoll?: (face) => void;Defined in: src/ui/die.ts:64
Called once the die has landed, with the face.
Parameters
face
number
Returns
void