开发者

Call a parent's method/property

开发者 https://www.devze.com 2023-04-01 08:12 出处:网络
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/pro

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

精彩评论

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