开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜