Tuesday 15 April 2014

javascript - dat.GUI create multiple buttons with same name -


I try to use dat.GUI to create multiple buttons with the same name "ShowCoord" it's possible? What I currently have:

 for  (i = 0; i  

Now I have the correct crowbo ['name'] and Karob ['numerical'] has been displayed. But all "ShowCoord" buttons only contain information about the last sub-oboj (the console is the "I have" + subobject ['index'], every time I click on the separate button on 148). How can I make it work? Thanks a lot!

out of sub-go for loop Try and modify the code so that you do not reassign it to Subgui varialbe.

  var subGui = new dat.GUI (); (I = 0; i & lt; subObjArray.length; i ++) for {var currObj = subObjArray [i]; SubGui.addFolder (currObj ['name']); // & lt; --- Work on this line subGui.add (currObj, 'numVertices'); SubGuide (Carogeb, "Showcard"); }  

Otherwise it will always be redefined with the last running element of loop


: this is just a hint That is, I can not get more conclusions than your code


No comments:

Post a Comment