Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Without the commented (//) line this recursive tree's node search function works well and find all scenes nodes. with it, CC says ("bad node name") and stop ! TableauBoutons =[]; RecuperePosition = function(nom_objet) { var count = ccbGetSceneNodeChildCount(nom_objet); if (count>0) { for(var i=0; i<count; ++i) { var child = ccbGetChildSceneNode(nom_objet, i); var s = ccbGetSceneNodeProperty(child, "Name"); if (s.substr(0,6)=="bouton") { // TableauBoutons.push(s); } RecuperePosition(child ); } } } var root = ccbGetRootSceneNode(); RecuperePosition(root); |
||||
|
thank you so much thats helped me alot |
||||
|
I do have a working recursive scene node function but its part of my dependencies file, which the function depends on other functions which also depend on others so... copying and pasting the function here wouldn't do any good. Since my dependencies file is supposed to release with my Enhanced FPS Camera, I can't release it here right now, sorry. |
||||
|
I'm happy it helps you Audrey. It was the first time I wrote a recursive function in 30 years programming ! xanimalkingx thanck you, and don't worry, now it works .. And I don't know why it didn't work before ! |
|