Skip to content Skip to sidebar Skip to footer

Refreshing Dat.gui Variable

This is a dropdown list within a dat.gui interface. Once you click any number, the jumpSwitcher will be whatever number you chose. I’m trying to replace each list that pertains t

Solution 1:

You have to re-create the contorller for the list of planets.

I modified your jsfiddle example here. The main stuff in

function updatePlanets(id) {
    var controller = gui.__controllers[2];
    controller.remove();
    gui.add(data, 'Planets', planets[id]).onChange(doSomeStuff);

    //back to 0 element
    data.Planets = 0;
    gui.__controllers[2].updateDisplay();
}

Also, it started to work, when I changed the version of DAT.GUI to 0.6.1

Post a Comment for "Refreshing Dat.gui Variable"