iphone - cocos2d 流行场景事件

标签 iphone objective-c cocos2d-iphone

如何让弹出的其他场景知道 popscene 事件?另一个场景又回到了视野中,但现在我想要发生一些事情,但我不知道触发它的最佳方式。

最佳答案

您可以使用CCNode的onEnter、onEnterTransitionDidFinish或onExit方法。在从 CCScene 派生的类中实现您想了解的方法。

- (void)onEnter
{
    [super onEnter];

    /*
     * This method is called every time the CCNode enters the 'stage'.
     */
}

- (void)onEnterTransitionDidFinish
{
    [super onEnterTransitionDidFinish];

    /*
     * This method is called when the transition finishes.
     */
}

- (void)onExit
{
    [super onExit];

    /*
     * This method is called every time the CCNode leaves the 'stage'.
     */
}

关于iphone - cocos2d 流行场景事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6119332/

相关文章:

ios - 拖动功能在 Google map iOS 应用程序中不起作用?

javascript - 方法作为参数类型

ios - 如何将下拉菜单添加到 iOS 中的导航栏标题

iphone - 如何预加载声音?

iphone 图像到 Ruby on Rails - 内容主体错误,parse_multipart

iphone - 使用parse实现Hashtag多对多关系?

ios - 游戏崩溃 背景有 3-5 个大 Sprite (每个 1920*640 ~100kb)~ 每个关卡 400-500kb

ios - Swift fatal error : Index out of range (out of bounds index)

c++ - cocos2d-x 中所有场景都可以访问的对象

iphone - 在没有 openGL 和 cocos2d 的情况下实现粒子系统的最简单方法是什么