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

      1. <small id='zrQnf'></small><noframes id='zrQnf'>

      2. <tfoot id='zrQnf'></tfoot>

          <bdo id='zrQnf'></bdo><ul id='zrQnf'></ul>
        <i id='zrQnf'><tr id='zrQnf'><dt id='zrQnf'><q id='zrQnf'><span id='zrQnf'><b id='zrQnf'><form id='zrQnf'><ins id='zrQnf'></ins><ul id='zrQnf'></ul><sub id='zrQnf'></sub></form><legend id='zrQnf'></legend><bdo id='zrQnf'><pre id='zrQnf'><center id='zrQnf'></center></pre></bdo></b><th id='zrQnf'></th></span></q></dt></tr></i><div id='zrQnf'><tfoot id='zrQnf'></tfoot><dl id='zrQnf'><fieldset id='zrQnf'></fieldset></dl></div>
      3. [[CCDirector sharedDirector]winSize] 错误

        [[CCDirector sharedDirector]winSize] is wrong([[CCDirector sharedDirector]winSize] 错误)

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

              <tfoot id='pnYYI'></tfoot>

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

              <legend id='pnYYI'><style id='pnYYI'><dir id='pnYYI'><q id='pnYYI'></q></dir></style></legend>
                • <bdo id='pnYYI'></bdo><ul id='pnYYI'></ul>
                    <tbody id='pnYYI'></tbody>
                • 本文介绍了[[CCDirector sharedDirector]winSize] 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  当我从根视图控制器的 init 方法调用 cocos2d 中的 CGSize winSize = [[CCDirector sharedDirector]winSize]; 并在它报告屏幕为纵向后立即调用 nslog "winSize"实际上它在风景中.当您从 -(void)onEnter 或从根视图加载的视图中调用它时,不会发生此错误.我看到其他一些人在谷歌搜索问题后遇到了这个问题,但没有人真正知道如何解决它,或者答案不适用于我.

                  When I call CGSize winSize = [[CCDirector sharedDirector]winSize]; in cocos2d from the init method of the root view controller and nslog "winSize" right after it reports that the screen is in portrait when in fact its in landscape. This error doesn't occur when you call it from -(void)onEnter or from a view that was loaded from the root view. I see that a few other people are having this problem after googling the problem but no one really seams to know how to fix it or the answer doesn't apply to me.

                  推荐答案

                  是的,这是 cocos2D 2.0 中的严重问题之一.当我尝试第一个场景的 init 方法时.

                  Yes, This is one of the serious problem in cocos2D 2.0. When I try in init method of first scene.

                  而不是 init 尝试 onEnter.

                  Instead of init try onEnter.

                  -(void)onEnter
                  {
                    [super onEnter];
                    CGSize winSize = [[CCDirector sharedDirector]winSize];
                  
                    //Place all your init functions here.
                  }
                  

                  注意:在 iphone5 中,缺少 Default-568h@2x.png 也会导致尺寸错误!!!Cocos2d 3.0:

                  Note: In iphone5, missing Default-568h@2x.png also result wrong size!!! Cocos2d 3.0:

                  CGSize s = [[CCDirector sharedDirector] viewSize];

                  CGSize s = [[CCDirector sharedDirector] viewSize];

                  这篇关于[[CCDirector sharedDirector]winSize] 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Resume game cocos2d(恢复游戏 cocos2d)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  <i id='mtxjA'><tr id='mtxjA'><dt id='mtxjA'><q id='mtxjA'><span id='mtxjA'><b id='mtxjA'><form id='mtxjA'><ins id='mtxjA'></ins><ul id='mtxjA'></ul><sub id='mtxjA'></sub></form><legend id='mtxjA'></legend><bdo id='mtxjA'><pre id='mtxjA'><center id='mtxjA'></center></pre></bdo></b><th id='mtxjA'></th></span></q></dt></tr></i><div id='mtxjA'><tfoot id='mtxjA'></tfoot><dl id='mtxjA'><fieldset id='mtxjA'></fieldset></dl></div>

                      <tbody id='mtxjA'></tbody>
                  1. <tfoot id='mtxjA'></tfoot>

                        • <small id='mtxjA'></small><noframes id='mtxjA'>

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