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 |
Elements list |
List of possible results.
Property name |
Description |
Name |
A text which will be visible in the Dice module. |
Image |
An image visible in the Dice module. |
|
Animation length |
Animation length of rolling the dice. |
Is Disabled |
Allows disabling the module so that the user is not able to interact with it. |
Initial Item |
The first dice item from the Elements list property. The Elements list is counted from 1. |
Works With |
An ID of the module which automatically supports the Dice module. |
Events
The Dice module sends the ValueChanged type event when the user starts rolling the dice.
Field name |
Description |
Value |
start |
If rolling the dice has been ended, the Dice module sends the ValueChanged type event with the element name if provided, otherwise the element index.
Field name |
Description |
Value |
the element's name or index if the name is not provided. |
Supported commands
Command name |
Params |
Description |
hide |
--- |
Hides the module if it is visible. |
show |
--- |
Shows the module if it is hidden. |
disable |
--- |
Disables the module. |
enable |
--- |
Enables the module. |
roll |
--- |
Rolling the dice. |
CSS classes
Class name |
Description |
.loading |
DIV which is visible when the module's images are loading. |
.addon-Dice-dice-container |
DIV container for images. |
.dice-element-visible |
This image is visible. |
.addon-Dice-image-element |
DIV which contains the background image. |
.isRolling |
Image class when rolling the dice. |
.disabled |
Wrapper class when the Dice module is disabled. |
Demo presentation
Demo presentation contains examples of how to use the Dice module.