Domanda

I'm trying to manually update a dat.gui controller. I followed the details on this page: http://workshop.chromeexperiments.com/examples/gui/#10--Updating-the-Display-Manually but it still does not work for me. Here is a sample of my code:

var ConfigData = function() {
                this.FrontColour = "#ffb752";

        };
config = new ConfigData();
var gui = new dat.gui();
var light = gui.addFolder('folder');
light.addColor( config, 'FrontColour').onChange( function(colorValue){
            externalElement.color.setHex(colorValue);
        });

Am I correct in saying I should just be able to update the variable config.FrontColour to a new colour. Then call updateDisplay() on the relevant gui.__controller for the dat.gui controller to display this new colour?

È stato utile?

Soluzione

I was trying to update the base gui controllers when I should of been updating the folder controllers ie. light.__controllers

Altri suggerimenti

Try this.FrontColour = 0xffb752;

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top