开发者

cocos2d popscene event

How can I let the other scene that gets popped know about the popscene event? T开发者_如何学编程he other scene goes back into view, but now I want something to happen and I can't figure out the best way to trigger it.


You can use onEnter, onEnterTransitionDidFinish or onExit methods of CCNode. Implement methods what you want to know about, in your class that is derived from 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'.
     */
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜