开发者

Iphone game development switching between scenes

开发者 https://www.devze.com 2023-01-31 09:18 出处:网络
i have created a pause button on touch the scene is replaced by the pause menu.... and when we resume the scene comes back开发者_如何学C...however the function keep calling themselves....

i have created a pause button on touch the scene is replaced by the pause menu....

and when we resume the scene comes back开发者_如何学C...however the function keep calling themselves....

how can i pause every thing in my current file when i switch to another scene...


"on touch", the running scene should call:

[[CCDirector sharedDirector] pushScene: [PauseMenu scene]];

The pause menu's "back to game" button should then call:

[[CCDirector sharedDirector] popScene];

Pushing the pause menu into place, should "pause" the scene that is currently being pushed back and when you pop it back it should continue running.

Documentation: http://www.cocos2d-iphone.org/api-ref/latest-stable/interface_c_c_director.html

0

精彩评论

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