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'.
*/
}
精彩评论