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

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

问题描述

我有一个带有少量 UIKit 元素的 CCScene [例如 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 是在 Cocos 使用的 EAGLView 中绘制的.您需要管理 EAGLView(s) 相对于其他 UIViews 的顺序.看看 http://www.gdcvault.com/play/1012504/The-Best-of-Both-Worlds 是一个将 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天全站免登陆