Open irwinb opened 13 years ago
Yes, I have tried to add a CCMenu with null argument to accompy this, but there may still be some bugs, Welcome any bug report and/or patch!
2011/8/17 irwinb < reply@reply.github.com>
Currently, if you instantiate a CCMenu without any children and add it to another node, the code flips out during some operations (ex. itemForTouch) because its list of children is null.
Maybe add some null checks or..ditch the lazy allocations? I'm not sure.
It would be nice if you are able to add CCMenu's to other nodes without the menu having any children..unless that is against the cocos2d spec. There are cases where it would be ideal to have an empty menu where the items get added later on due to some game logic.
Thanks!
Reply to this email directly or view it on GitHub: https://github.com/ZhouWeikuan/cocos2d/issues/31
Currently, if you instantiate a CCMenu without any children and add it to another node, the code flips out during some operations (ex. itemForTouch) because its list of children is null.
Maybe add some null checks or..ditch the lazy allocations? I'm not sure.
It would be nice if you are able to add CCMenu's to other nodes without the menu having any children..unless that is against the cocos2d spec. There are cases where it would be ideal to have an empty menu where the items get added later on due to some game logic.
Thanks!