Call a parent's method/property
I have a custom class and I add it as child of a scene. In this custo开发者_StackOverflow社区m class, I'd like to call a method or property found in the scene. So basically how can I call methods/properties from
You can use CocosNode's get_ancestor(self, klass)
routine to discover the objects that contain the node. If you specify the scene's class in the klass
parameter, that routine should give you the object you're looking for.
精彩评论