Static
DICE_Limit of 3D dice to allow on table at any one time
Static
DefaultDefault Config
Optional
apiAPI Connection
Available after calling connect
Optional
apiAPI Key
Optional
canvasCanvas
Construct and initialize the object
Optional
canvas: HTMLCanvasElementCanvas element
Optional
apiKey: stringRequired if connecting to the dddice API
Optional
config: Partial<IEngineConfig>Optional configuration to change the look and feel of the renderer
Static
isConnect to the live server and begin listening to room events.
Note: Your user must be a participant in a room in order to listen to events, otherwise an error is thrown.
Room slug to listen on
Optional
roomPasscode: stringPrivate passcode to access room
Optional
userUuid: stringPersonal User UUID to listen to whispers
Connect to the live server and begin listening to room events.
Note: Your user must be a participant in a room in order to listen to events, otherwise an error is thrown.
Manually trigger an event
The event to dispatch
Rest
...params: any[]Initialize object if the default constructor had been called
Optional
canvas: HTMLCanvasElementCanvas element
Optional
apiKey: stringRequired if connecting to the dddice API
Optional
config: Partial<IEngineConfig>Optional configuration to change the look and feel of the renderer
Optional
appName: stringOptional name to identify which application is connecting to dddice
Load a theme, including shaders, into the engine
Remove callback from event
The event to stop listening to
Listen for an event and execute a callback.
The event to listen on
The function to execute when the event is fired
Pick up dice
This clears certain dice from the board and updates the API
void
Load assets for a loaded theme
This loads all meshes, textures, and sounds for a dice theme. Calling this multiple times will debounce the loading processing for 50ms
Returns a list of items to be queued
Resize canvas
Width of canvas in pixels
Height of canvas in pixels
Roll dice using the dddice API. This method submits the roll to the server to be distributed to all room participants.
Optional
options: IDiceRollOptionsSet configuration
Start the renderer
Stop the renderer
Change the hidden state of a roll
Optionally pass the uuids of specific dice to only unhide those dice, otherwise all dice in the roll will be revealed.
void
IRoll Roll to unhide
Optional array of dice uuids
Get mouse/pointer controls enabled
Set mouse/pointer controls enabled
Canvas Height
Get if a roll is currently animating
Get the current version of dddice
Canvas width
Generated using TypeDoc
ThreeDDice Class