• <bdo id='lUs91'></bdo><ul id='lUs91'></ul>

    <tfoot id='lUs91'></tfoot>

      <legend id='lUs91'><style id='lUs91'><dir id='lUs91'><q id='lUs91'></q></dir></style></legend>

      <small id='lUs91'></small><noframes id='lUs91'>

      <i id='lUs91'><tr id='lUs91'><dt id='lUs91'><q id='lUs91'><span id='lUs91'><b id='lUs91'><form id='lUs91'><ins id='lUs91'></ins><ul id='lUs91'></ul><sub id='lUs91'></sub></form><legend id='lUs91'></legend><bdo id='lUs91'><pre id='lUs91'><center id='lUs91'></center></pre></bdo></b><th id='lUs91'></th></span></q></dt></tr></i><div id='lUs91'><tfoot id='lUs91'></tfoot><dl id='lUs91'><fieldset id='lUs91'></fieldset></dl></div>
      1. cocos2d游戏中如何实现暂停/恢复?

        时间:2024-08-12

        <legend id='ygfTH'><style id='ygfTH'><dir id='ygfTH'><q id='ygfTH'></q></dir></style></legend>
          <i id='ygfTH'><tr id='ygfTH'><dt id='ygfTH'><q id='ygfTH'><span id='ygfTH'><b id='ygfTH'><form id='ygfTH'><ins id='ygfTH'></ins><ul id='ygfTH'></ul><sub id='ygfTH'></sub></form><legend id='ygfTH'></legend><bdo id='ygfTH'><pre id='ygfTH'><center id='ygfTH'></center></pre></bdo></b><th id='ygfTH'></th></span></q></dt></tr></i><div id='ygfTH'><tfoot id='ygfTH'></tfoot><dl id='ygfTH'><fieldset id='ygfTH'></fieldset></dl></div>

          <small id='ygfTH'></small><noframes id='ygfTH'>

              • <bdo id='ygfTH'></bdo><ul id='ygfTH'></ul>
                  <tbody id='ygfTH'></tbody>
                1. <tfoot id='ygfTH'></tfoot>
                  本文介绍了cocos2d游戏中如何实现暂停/恢复?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的问题是寻找 cocos2d 游戏期间暂停/恢复状态(包括所有需要保存的数据信息)的设计解决方案.

                  My question is to look for design solution for pause/resume states (including all data info, which need save ) during cocos2d game.

                  包括但不限于以下情况:

                  Including following cases, but not limited:

                  1).用户选择退出,然后弹出一个对话框供用户选择直接退出"、暂停";

                  1). User choose quit, then pop out one dialog for user to choose " quit directly", " pause " ;

                  2).有人呼入,弹出对话框供用户选择退出"或暂停"游戏.

                  2). Someone call in , pop out dialog for user to choose "quit " or " pause " game.

                  如果选择暂停",应该保存所有值得保存的内容.就像 PC 游戏一样.

                  If choose "pause", everything which deserve saving, should be saved. Just like PC games do.

                  我知道导演提供了暂停"、恢复",这个任务可以吗?

                  I know Director provides "pause" , "resume " , is that okay for this task ?

                  感谢任何线索或评论.

                  欢迎通过电子邮件进一步讨论:apple.dev.sh@gmail.com

                  Welcome for further discussing via email : apple.dev.sh@gmail.com

                  推荐答案

                  这是一个很好的例子:

                  暂停:

                  - (void) applicationDidEnterBackground:(UIApplication *)application
                  {
                      [[CCDirector sharedDirector] stopAnimation];
                      [[CCDirector sharedDirector] pause];
                  }
                  - (void)applicationWillResignActive:(UIApplication *)application
                  {
                      [[CCDirector sharedDirector] stopAnimation];
                      [[CCDirector sharedDirector] pause];
                  }
                  

                  恢复时:

                  - (void)applicationDidBecomeActive:(UIApplication *)application
                  {
                      [[CCDirector sharedDirector] stopAnimation]; // call this to make sure you don't start a second display link!
                      [[CCDirector sharedDirector] resume];
                      [[CCDirector sharedDirector] startAnimation];
                  }
                  

                  这篇关于cocos2d游戏中如何实现暂停/恢复?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:是否可以实现 MAX(As,Ad) openGL 混合? 下一篇:cocos2D for iPhone 和触摸检测的问题

                  相关文章

                  <small id='eOcpR'></small><noframes id='eOcpR'>

                    <bdo id='eOcpR'></bdo><ul id='eOcpR'></ul>

                  1. <tfoot id='eOcpR'></tfoot>
                  2. <legend id='eOcpR'><style id='eOcpR'><dir id='eOcpR'><q id='eOcpR'></q></dir></style></legend>

                    1. <i id='eOcpR'><tr id='eOcpR'><dt id='eOcpR'><q id='eOcpR'><span id='eOcpR'><b id='eOcpR'><form id='eOcpR'><ins id='eOcpR'></ins><ul id='eOcpR'></ul><sub id='eOcpR'></sub></form><legend id='eOcpR'></legend><bdo id='eOcpR'><pre id='eOcpR'><center id='eOcpR'></center></pre></bdo></b><th id='eOcpR'></th></span></q></dt></tr></i><div id='eOcpR'><tfoot id='eOcpR'></tfoot><dl id='eOcpR'><fieldset id='eOcpR'></fieldset></dl></div>