Documentation

Dice

Description

The Dice module allows getting a random value by rolling the dice. Works with the Board Game module.

Properties

The list starts with the common properties, learn more about them by visiting the Modules description section. The other available properties are described below.

Property name Description
Is disabled Allows disabling the module so that the user is not able to interact with it.
Elements list List of possible results
Property name Description
Name A text which will be visible in Dice addon.
Image An image visible in Dice addon

Animation length Animation length of the dice rolling
Initial item The first dice item from the "Elements" list property. The "Elements" list is counted from 1.
Works with An ID of the addon which automatically supports Dice addon.

Events

The Dice Addon sends the ValueChanged type event when the user starts dice rolling.

Field name Description
Value start

If dice rolling has been ended, the Dice addon sends the ValueChanged type event with the element name if provided, otherwise the element index.

Field name Description
Value an element name or element index if the name is not provided.

Supported commands

Command name Params Description
show --- Shows the addon.
hide --- Hides the addon.
disable --- Disables the addon.
enable --- Enables the addon.
roll --- Dice rolling

CSS classes

Class name Description
.loading DIV which is visible when addon images are loading.
.addon-Dice-dice-container DIV container for images.
.dice-element-visible This image is actually visible
.addon-Dice-image-element DIV which contains a background image.
.isRolling Image class when the addon is rolling.
.disabled Wrapper class when the addon is disabled.

Demo presentation

Demo presentation contains examples showing how this addon can be used.