我有一个显示分数和名称的UITableView。我也有动画的对象,在屏幕上移动..但是,他们在tableview下,不管是什么z-index值都不可见。我如何让动画对象在我的UITableView之上? 谢谢..Cocos2D z-index问题与openGLView
0
A
回答
0
您必须添加UITableView作为CCDirector的openGLView的子视图。
与对象的所有COCOS2D动画都在openGLView上,这显然低于TableView,所以z索引在这种情况下不会起作用。
您所要做的就是直接在UIWindow上插入UITableView并将其移动到openGLView的下方。您还可以使用:
[<UIWindow> insertSubview:<TableView> belowSubview:<openGLView>];
所有你需要做的就是让你openGLView透明,并确保您有添加在CCLayer没有背景图片(否则将覆盖)
这样的问题是锄头,让您的openGLView - 透明
-(void) initGLDefaultValues
{
// This method SHOULD be called only after openGLView_ was initialized
NSAssert(openGLView_, @"openGLView_ must be initialized");
[self setAlphaBlending: YES];
[self setDepthTest: YES];
[self setProjection: CCDirectorProjectionDefault];
// ***** NEW CODE: make open gl view transparent
openGLView_.opaque = NO;
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
// disable regular, opaque clear color
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
// ***** NEW CODE end
}
1
继续之前(山姆·费雪的解决方案可放置下面的cocos2d看法所有的UIKit)记住这一点:
在技术上不可能在cocos2d中有一个UIKit视图,其中cocos2d同时在UIKit视图的前面和后面绘制节点。
换句话说:UIKit视图既可以完全位于所有cocos2d节点的前面,也可以完全位于所有cocos2d节点的后面。
原因是cocos2d是从UIKit的角度来看的一个视图。
相关问题
- 1. FF4 - CSS zindex问题
- 2. 问题与在cocos2d
- 3. 与ios5 Cocos2d问题
- 4. icarousel与cocos2d问题
- 5. Highcharts zIndex问题与十字线
- 6. 如何解决与闪光zindex问题
- 7. 可可OpenGLView与VAOs
- 8. 父zIndex问题IE6和IE7
- 9. jQuery zIndex div显示问题
- 10. 问题与触摸在cocos2D
- 11. Cocos2d问题/问题
- 12. Cocos2D CCSprite问题?
- 13. Pythonpath问题 - Cocos2d
- 14. CSS zIndex问题。里面的链接
- 15. 浮动窗口和zindex应用问题
- 16. 两个ASPxDockPanel之间的zIndex问题
- 17. 问题与意图在cocos2d android
- 18. 问题与cocos2d游戏开始
- 19. 小问题与cocos2d的草图板
- 20. 在openGLView中添加一个CCLabel ontop - cocos2d iphone
- 21. cocos2d语义问题
- 22. Cocos2d-x boundingBox问题
- 23. Cocos2d-x setDesignResolutionSize问题
- 24. iphone cocos2d iAd问题
- 25. cocos2d调试问题
- 26. Cocos2d CCSpirte runAction问题
- 27. 更新问题cocos2d
- 28. OpenGLView无法显示
- 29. OpenGLView里面的UIView
- 30. “scheduledTimerWithTimeInterval:”在cocos2d中的问题?