Domanda

I have a gui where the use can select different shapes to render with a dropdown. This works well. Now I wanna display a folder with some slider. The count, name and min/max values of the sliders differ in which shape is selected. How can I accomplish this with dat.gui.

È stato utile?

Soluzione

Ok found a solution by adding this to the dat.GUI prototype:

dat.GUI.prototype.removeFolder = function(name) {
  var folder = this.__folders[name];
  if (!folder) {
    return;
  }
  folder.close();
  this.__ul.removeChild(folder.domElement.parentNode);
  delete this.__folders[name];
  this.onResize();
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top