This creates a button with text left aligned.
var obj = { add:function(){ console.log("clicked") }};
gui.add(obj,'add');
题
I would like to create a button using dat.gui library. In a perfect world, this would work like this:
gui.add("button", "click me");
解决方案
This creates a button with text left aligned.
var obj = { add:function(){ console.log("clicked") }};
gui.add(obj,'add');
其他提示
FWIW, dat.gui assumes the GUI type based on the target's initial value type.
Examples can be found here: http://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage