dat.gui how to hide menu with code

后端 未结 7 944
太阳男子
太阳男子 2021-02-06 04:06

I made a menu using dat.gui for my applcation with Three.js. It works fine, I have also discovered that pressing h key I can hide the menu created with dat.gui. My question is h

7条回答
  •  暖寄归人
    2021-02-06 04:27

    Ok found a solution by adding the following function to the prototype of dat.GUI:

      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();
      }
    

提交回复
热议问题