如何在 UIView 上添加 CCSprite如何在、UIView、CCSprite

由网友(从前不快乐)分享简介:In my cocos2d application, I have a UIView that I am displaying on my screen by adding a subview to [[CCDirector sharedDirector] openGLView], but I am wondering...

In my cocos2d application, I have a UIView that I am displaying on my screen by adding a subview to [[CCDirector sharedDirector] openGLView], but I am wondering if there is someway to display a CCSprite above this view, since I have to do lots of interactions and animations with those CCObjects.

Please help. Thanks in advance...

解决方案 photoshop cc 2017怎么从英文切换为简体中文

Of course you can't add CCSprite on UIView. CCSprite is from Cocos2d library class and UIView is UIKit class. If you want add UIView over game view then you need to access rootviewcontroller view which is root of UIWindow. Its something like this,

[appDelegate.yourRootViewController.view addSubview:yourview];

Always keep remember Cocos2d library control are part of GLView.

阅读全文

相关推荐

最新文章