I found this function to remove the gui element, but I think it is deprecated. So far, I have not been able to find anyone else who knows how to remove any part of gui, be it the entire dat.GUI () or just the added element in dat.GUI (). The first one will probably be sufficient for what I need (just delete dat.GUI () all together), but any of them will be very useful!
supposed to remove dat.GUI ()
gui = new dat.GUI();
...
removeGui(gui); function removeGui(gui, parent) { if(!parent) { parent = dat.GUI.autoPlaceContainer; } parent.removeChild(gui.domElement); }
But it returns an error: you cannot call the removeChild method from undefined, so I assume that autoPlaceContainer is wrong.
The original author of this function left these notes:
where the gui parameters represent the DAT.GUI you want to remove, and the parent is the parent container, unless you specified domElement when creating the DAT.GUI, you do not need to pass the parent element.
user2287949
source share