new GUI(template)
Parameters:
Name | Type | Description |
---|---|---|
template | Object | A set of name/object pairs, one per UI element |
Example
const gui = new GUI ({
opacity: { // slider
val: [canvas.opacity, [0, 1, 0.1]],
cmd: val => canvas.setOpacity(val),
},
download: { // button
cmd: () => util.downloadBlob(data, 'data.json', false),
},
...
})
Methods
addUI(obj, key)
Parameters:
Name | Type | Description |
---|---|---|
obj | Object | A gui object with two optional objects: 'val' and 'cmd' |
key | string | The name of the gui |
Returns:
A dat.gui control object