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

  • <legend id='x0pwy'><style id='x0pwy'><dir id='x0pwy'><q id='x0pwy'></q></dir></style></legend>

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

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

      2. CCDirecter 用 UIView/nib 替换场景

        CCDirecter replace scene with UIView / nib(CCDirecter 用 UIView/nib 替换场景)
          • <bdo id='ZZyIJ'></bdo><ul id='ZZyIJ'></ul>
          • <small id='ZZyIJ'></small><noframes id='ZZyIJ'>

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

                <tbody id='ZZyIJ'></tbody>

            1. <tfoot id='ZZyIJ'></tfoot>

                  本文介绍了CCDirecter 用 UIView/nib 替换场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想做的是让 Cocos2d 共享导演用 UIKit 中的 UIView 替换当前场景(可能从笔尖加载).这个想法是在 Cocos2d 和 UIKit 之间进行干净的转换.

                  What I would like to do is have the Cocos2d shared director to replace the current scene with a UIView from UIKit (possibly loaded from a nib). The idea being to cleanly transition between Cocos2d and UIKit.

                  我已经看到了一些解决这个问题的方法.其中大部分是关于在同一场景中将 UIKit 与 Cocos2d 混合,我想将它们分开.一种方法是添加 UIView 的实例作为导向器 GLView 的子视图.像这样:

                  I've seen a few approaches to this problem. Most of them are about mixing UIKit with Cocos2d in the same scene, I'd like to keep them separate. One approach is to add an instance of UIView as a subview of the directors GLView. Like so:

                  UIView* cocosView = [[CCDirector sharedDirector] openGLView];
                  [cocosView addSubview:t];
                  

                  将 UIView 叠加到 Cocos 层上?

                  这可行,但我必须先创建一个空白场景并过渡到该场景,然后添加 UIView,然后将其删除并过渡到任何其他场景.这是模块化的,但有点混乱.

                  This works but I would have to create a blank scene and transition to that first, then add the UIView, then later remove it and transition to whatever other scene. That's modular but a little messy.

                  更好的方法是将 UIView 包装到节点中.就像是:http://www.cocos2d-iphone.org/forum/topic/6889

                  A better approach is to wrap a UIView into a node. Something like: http://www.cocos2d-iphone.org/forum/topic/6889

                  有官方的 cocos2d 扩展吗?如果可能的话,我还想从故事板/笔尖加载 UIView.非常感谢.

                  Is there an official cocos2d extension for this? I'd also like to load the UIView from storyboard/nib if possible. Much obliged.

                  推荐答案

                  用 UIKit 中的 UIView 替换当前场景

                  replace the current scene with a UIView from UIKit

                  如果你使用 cocos2d 1.x:http://www.raywenderlich.com/4817/how-to-integrate-cocos2d-and-uikit

                  if you are using cocos2d 1.x: http://www.raywenderlich.com/4817/how-to-integrate-cocos2d-and-uikit

                  如果你使用 cocos2d 2.x:CCDirector 是 UIViewController 的子类,所以你可以使用 常用方法.停止后的增量时间计算存在一点错误/开始动画,但很容易修复.

                  if you are using cocos2d 2.x: CCDirector is a subclass of UIViewController, so you can use usual methods. There's a little bug with delta time calculation after stopping/starting animation, but it's easy to fix.

                  这篇关于CCDirecter 用 UIView/nib 替换场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(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 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)

                      <tbody id='GGKid'></tbody>
                      • <bdo id='GGKid'></bdo><ul id='GGKid'></ul>

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

                          1. <legend id='GGKid'><style id='GGKid'><dir id='GGKid'><q id='GGKid'></q></dir></style></legend>

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