realm15-dicebox
v0.0.17
Published
A 3D environment for rolling game dice using threejs and cannon-es
Downloads
16
Maintainers
Readme
realm15-dicebox
3D Dice implemented with ThreeJS and Cannon ES
Based on Major's 3D Dice and https://github.com/3d-dice/dice-box-threejs
Install using NPM
npm i realm15-dicebox
Config Options
const defaultConfig = {
framerate: (1/60),
sounds: false,
volume: 100,
color_spotlight: 0xefdfd5,
shadows: true,
theme_surface: "green-felt",
sound_dieMaterial: 'plastic',
theme_customColorset: null,
theme_colorset: "white",
theme_texture: "",
theme_material: "glass", // "none" | "metal" | "wood" | "glass" | "plastic"
gravity_multiplier: 400,
light_intensity: 0.7,
baseScale: 100,
strength: 1, // toss strength of dice
onRollComplete: () => {}
}
Predetermined Outcomes
The notation to roll your predetermined outcomes looks like this:
Box.roll("6d6@4,4,4,4,4,4") // rolls six dice that will land on 4's