javascriptdat.gui

Is it possible to create a button using dat.gui


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");

Solution

  • This creates a button with text left aligned.

    var obj = { add:function(){ console.log("clicked") }};
    
    gui.add(obj,'add');