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

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

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

        <tfoot id='HF5CK'></tfoot>

      1. 如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?

        How can I implement a virtual joystick for a cocos2d game outside the cocos2d environment?(如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?)
        <i id='KL7aK'><tr id='KL7aK'><dt id='KL7aK'><q id='KL7aK'><span id='KL7aK'><b id='KL7aK'><form id='KL7aK'><ins id='KL7aK'></ins><ul id='KL7aK'></ul><sub id='KL7aK'></sub></form><legend id='KL7aK'></legend><bdo id='KL7aK'><pre id='KL7aK'><center id='KL7aK'></center></pre></bdo></b><th id='KL7aK'></th></span></q></dt></tr></i><div id='KL7aK'><tfoot id='KL7aK'></tfoot><dl id='KL7aK'><fieldset id='KL7aK'></fieldset></dl></div>
          <tfoot id='KL7aK'></tfoot>

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

              <tbody id='KL7aK'></tbody>

              • <bdo id='KL7aK'></bdo><ul id='KL7aK'></ul>
                <legend id='KL7aK'><style id='KL7aK'><dir id='KL7aK'><q id='KL7aK'></q></dir></style></legend>
                  本文介绍了如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在开发一个使用 cocos2d 并且需要虚拟操纵杆的 iPad 游戏.我使用 SneakyJoystick 建立并运行了一个原型.

                  I am developing an iPad game that uses cocos2d and requires a virtual joystick. I have a prototype up and running using SneakyJoystick.

                  然而,我意识到我的游戏设计需要我使用 CCTransitions 在 CCScene 的不同实例之间移动用户以获得我想要的视觉效果.问题是,我不希望用户控件(如操纵杆)受到 CCTransitions 的影响——我希望它们保留在屏幕上(在屏幕的不同部分,而不是 CCScene 占据的部分.)

                  However, I realized that my game design requires me to use CCTransitions to move the user between different instances of CCScene in order to get the visual effect I want. The problem is, I don't want the user controls (like the joystick) to be affected by the CCTransitions- I want them to remain on the screen (in a different part of the screen than the part occupied by the CCScene.)

                  我意识到做到这一点的唯一方法是将整个 cocos2d 环境保留在一个 EAGLView 中,它占据的区域小于整个屏幕,这允许我将所有用户控件保留在屏幕上的其他位置,它们不受场景转换.

                  I realized the only way to do this was to keep the entire cocos2d environment in an EAGLView that occupies an area smaller than the entire screen, which allows me to keep all the user controls elsewhere on the screen, where they are unaffected by the scene transitions.

                  问题是,这意味着 SneakyJoystick 可能不再是一个选项,因为它是一个 CCNode,因此可能只能在 cocos2d 场景图中运行.

                  The problem is, that means SneakyJoystick is probably no longer an option, as it is a CCNode that therefore will probably only run within the cocos2d scene graph.

                  我很好奇是否有人对这种情况有替代解决方案:一种在 cocos2d 环境之外实现虚拟操纵杆的方法,但它可以以某种方式与 cocos2d 场景进行流畅的通信.

                  I am curious if anyone has an alternative solution for this situation: A way of implementing a virtual joystick outside the cocos2d environment, but that can somehow communicate fluidly with the cocos2d scene.

                  如果我可以保留 SneakyJoystick 或其他类似功能的功能,那就太好了,方法是从这个非 cocos2d 类中利用 cocos2d 的预定更新,或者以其他方式将用户输入信息从操纵杆类推送到 cocos2d.

                  It would be great if I could retain the functionality of SneakyJoystick or something very similar, by either tapping into the scheduled updates of cocos2d from this non-cocos2d class, or somehow otherwise pushing user input information from the joystick class to cocos2d.

                  推荐答案

                  可能你可以创建一个 UIView 并将它放在 opengl 视图上.要访问 openglView,请使用 [CCDirector sharedDirector].openGLView.使用 UIView 创建您的游戏杆.所以它会一直显示,并且不受 CCScene 过渡的影响.

                  Possibly you can create an UIView and put it over the opengl view. To access the openglView use [CCDirector sharedDirector].openGLView. Create your joystick using UIView. So it will be always shown, and will be not affected by CCScene transitions.

                  这篇关于如何在 cocos2d 环境之外实现 cocos2d 游戏的虚拟摇杆?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 场景重启?)

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

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

                      <tfoot id='meD8B'></tfoot>
                    • <small id='meD8B'></small><noframes id='meD8B'>

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