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

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

  • <tfoot id='cN8pM'></tfoot>

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

        <legend id='cN8pM'><style id='cN8pM'><dir id='cN8pM'><q id='cN8pM'></q></dir></style></legend>
      1. [ios.cocos2d+box2d]如何禁用自动旋转?

        时间:2024-08-12

        <small id='0EnnD'></small><noframes id='0EnnD'>

          <tbody id='0EnnD'></tbody>

        • <legend id='0EnnD'><style id='0EnnD'><dir id='0EnnD'><q id='0EnnD'></q></dir></style></legend>
            <bdo id='0EnnD'></bdo><ul id='0EnnD'></ul>

                  <i id='0EnnD'><tr id='0EnnD'><dt id='0EnnD'><q id='0EnnD'><span id='0EnnD'><b id='0EnnD'><form id='0EnnD'><ins id='0EnnD'></ins><ul id='0EnnD'></ul><sub id='0EnnD'></sub></form><legend id='0EnnD'></legend><bdo id='0EnnD'><pre id='0EnnD'><center id='0EnnD'></center></pre></bdo></b><th id='0EnnD'></th></span></q></dt></tr></i><div id='0EnnD'><tfoot id='0EnnD'></tfoot><dl id='0EnnD'><fieldset id='0EnnD'></fieldset></dl></div>
                  <tfoot id='0EnnD'></tfoot>
                1. 本文介绍了[ios.cocos2d+box2d]如何禁用自动旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我用 cocos2d 0.99.5 + box2d 创建了一个项目.当我旋转我的 iPhone 时,屏幕也会自动旋转.于是箱子飞到了天花板上.

                  I have created a project with cocos2d 0.99.5 + box2d. When I rotate my iphone, Screen automatically rotated too. So the boxes Flew up into the ceiling.

                  如何禁用自动旋转?

                  推荐答案

                  在 coco2d 0.99.5 中,模板会创建一个名为 GameConfig.h 的文件,您可以在其中选择控制应用旋转的系统.默认是

                  In coco2d 0.99.5, the template creates a file called GameConfig.h, where you get to choose what system controls the app's rotation. The default is

                  #define GAME_AUTOROTATION kGameAutorotationUIViewController
                  

                  现在看看 RootViewController.m 内部,或者你在文件中命名的任何内容.在

                  Now take a look inside RootViewController.m, or whatever you've named it in your file. in the

                  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
                  

                  方法,您将看到许多 #if#elif 编译器指令.查看 kGameAutorotationUIViewController 发送给我们的部分:

                  method, you'll see a number of #if and #elif compiler directives. Check out the section that kGameAutorotationUIViewController sends us to:

                  #elif GAME_AUTOROTATION == kGameAutorotationUIViewController
                  //
                  // EAGLView will be rotated by the UIViewController
                  //
                  // Sample: Autorotate only in landscpe mode
                  //
                  // return YES for the supported orientations
                  if( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ||
                     interfaceOrientation == UIInterfaceOrientationLandscapeRight )
                      return YES;
                  
                  // Unsupported orientations:
                  // UIInterfaceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown
                  return NO;
                  

                  要使您的游戏保持单一方向,请将中间的 if 语句更改为:

                  To keep your game at a single orientation, change that middle if statement to read:

                  if( interfaceOrientation == UIInterfaceOrientationPortrait)
                      return YES;
                  

                  或者你决定它是你想要的任何方向.希望这会有所帮助!

                  Or whatever orientation you decide it is that you want. Hope this helps!

                  这篇关于[ios.cocos2d+box2d]如何禁用自动旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:游戏中心 facebook 喜欢 下一篇:正确的 cocos2d 场景重启?

                  相关文章

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

                      <bdo id='6xjqx'></bdo><ul id='6xjqx'></ul>

                  2. <small id='6xjqx'></small><noframes id='6xjqx'>

                    <tfoot id='6xjqx'></tfoot><legend id='6xjqx'><style id='6xjqx'><dir id='6xjqx'><q id='6xjqx'></q></dir></style></legend>