uikit 元素上的 Cocos2d 节点节点、元素、uikit、Cocos2d

由网友(生来不讨喜)分享简介:我有一个带有少量 UIKit 元素的 CCScene [例如 UITextView].经过一些用户交互后,我想在场景上打开一个弹出窗口以覆盖部分 UITextView.我使用什么 z 索引并不重要,它总是会出现在文本视图下.有什么建议吗?I've got a CCScene with few UIKit elemen...

我有一个带有少量 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.

阅读全文

相关推荐

最新文章