uikit元素上的Cocos2d节点 [英] Cocos2d node over uikit element

查看:54
本文介绍了uikit元素上的Cocos2d节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CCScene,其中包含几个UIKit元素[例如UITextView].在进行一些用户交互之后,我想在场景上打开一个弹出窗口,以同时覆盖UITextView的一部分.我使用什么z索引都没有关系,它将始终出现在文本视图下.有关如何操作的任何提示?

I've got a CCScene with few UIKit elements [UITextView for example]. After some user interaction I want to open a popup over the scene to also cover part of the UITextView. It doesn't matter what z index I am using, it will always appear under the text view. Any tips on how to do it?

推荐答案

您的CCNode绘制在EAGLView Cocos正在使用的内部.您需要管理EAGLView相对于其他UIView的顺序.看看 http://www.gdcvault.com/play/1012504/两全其美,以将EAGLViews中的Cocos绘图与其他UIKit视图混合的示例.

Your CCNodes are drawn within the EAGLView Cocos is using. You need to manage the order of EAGLView(s) relative to other UIViews. Take a look at http://www.gdcvault.com/play/1012504/The-Best-of-Both-Worlds for an example of mixing Cocos drawing in EAGLViews with other UIKit views.

这篇关于uikit元素上的Cocos2d节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆