开发者

How can I return from one scene to another on Cocos2D

I'm trying to play a "cut scene" with cocos2d. I use:

[[CCDirector sharedDirector] replaceScene:[CCCrossFadeTransition transitionWithDuration:0.2 scene:[s node]]];

to play the new scene.

However, i want to return to the previous screen when i'm done playing this cut scene开发者_Python百科.

Can anyone help me?


You can use pushScene: to switch to the new scene (instead of replaceScene:) and popScene to return to the previous one (so this works like a stack).

This will keep the old scene in memory, see also cocos2d Best Practices.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜