Skip to main content
Version: 0.6

Box Controls

Box Controls uses the popular dat.GUI module which is self described as:

A lightweight graphical user interface for changing variables in JavaScript

Use this module if you want to dynamically experiment with the Dice-Box config settings and see real time feedback. All changes are passed to Dice-Box's updateConfig() method.

Install

Add the FUI module using

npm install @3d-dice/fui

Setup

Then create a new instace of the picker

import { BoxControls } from '@3d-dice/fui'

const Controls = new BoxControls({
onUpdate: (updates) => {
diceBox.updateConfig(updates)
}
})

Settings

Sliders

Config Optionsmindefaultmaxstep
gravity01101
mass11201
friction0.81.1
restitution001.1
linearDamping0.51.1
angularDamping0.41.1
spinForce06151
throwForce03151
startingHeight120651
settleTimeout 10005000200001000
delay101050010
scale1410.1
note

While the slider has a max setting, there is no enforced max in the module itself.

Checkbox

Config Optiondefault
enableShadowstrue

Combo Box

Config Optiondefaultoptions
theme'undefined'purpleRock | diceOfRolling | galvanized

Color Picker

Config Optiondefault
theme#0974E6
Theme config

There are two controls for themes. One is the combo box with named themes and the other is the color picker. Whichever option was last set is the one that will be passed on to updateConfig