the die manager
the stock element (should be an empty HTML Element)
ProtecteddiceProtectedelementthe stock element (should be an empty HTML Element)
Protectedmanagerthe die manager
OptionalonCalled when selection change. Returns the clicked die.
die: the clicked die (can be selected or unselected)
OptionalonCalled when selection change. Returns the selection.
selection: the selected dice of the stock
lastChange: the last change on selection die (can be selected or unselected)
ProtectedselectableProtectedselectedProtectedselectionProtected OptionalsortAdd an array of dice to the stock.
the dice to add
Optionalsettings: AddDieSettingsa AddDiceettings object
if number, the number of milliseconds between each die. if true, chain animations
Add a die to the stock.
the die to add
Optionalsettings: AddDieToVoidStockSettingsa AddDieToVoidStockSettings object
the promise when the animation is done (true if it was animated, false if it wasn't)
ProtectedaddOptionalsettings: AddDieSettingsProtectedaddOptionalsettings: AddDieSettingsProtectedaddProtectedaddOptionalsettings: AddDieSettingsProtectedanimationThe element to animate. The element is added to the destination stock before the animation starts.
The HTMLElement to attach the die to.
ProtectedbindProtectedcanChecks if the die can be added. By default, only if it isn't already present in the stock.
the die to add
Optionalsettings: AddDieSettingsthe addDie settings
if the die can be added
Protecteddiethe filtering to apply on die click events. Use setting from manager if unset.
the dice on the stock
ProtectedgetProtectedgetProtectedgetthe class to apply to selectable dice. Use class from manager is unset.
the class to apply to selected dice. Use class from manager is unset.
the selected dice
the class to apply to selectable dice. Use class from manager is unset.
if the stock is empty
Remove a set of dice from the stock.
the dice to remove
Optionalsettings: RemoveDieSettingsa RemoveDieSettings object
Remove a die from the stock.
die die to remove
Optionalsettings: RemoveDieSettingsa RemoveDieSettings object
Start the rolling dice animation. Usually, you want to change the dice faces just before rolling them.
Optionalsettings: RollDieSettingsStart the rolling die animation. Usually, you want to change the die face just before rolling it.
Optionalsettings: RollDieSettingsSelect all dice
Set the selectable class for each die.
OptionalselectableDice: T[]the selectable dice. If unset, all dice are marked selectable. Default unset.
ProtectedsetSet if the stock is selectable, and if yes if it can be multiple. If set to 'none', it will unselect all selected dice.
the selection mode
OptionalselectableDice: T[]the selectable dice (all if unset). Calls setSelectableDice method
Returns if a die should be placed on this stock (with the autoPlace setting).
Unelect all dice
Set unselected state to a die.
the die to unselect
A stock to make dice disappear (to automatically remove disdieed dice, or to represent a bag)