且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 UIView 上添加 CCSprite

更新时间:2023-11-17 13:35:52

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.