I was trying to update the base gui controllers when I should of been updating the folder controllers ie. light.__controllers
Manually updating dat.gui
-
30-05-2022 - |
Question
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?
Solution
OTHER TIPS
Try this.FrontColour = 0xffb752;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow