Search code examples
iphonesdkcocos2d-iphoneintegrate

Combining Cocos2D view into an existing tabbar app


I have an app with a main tabBar view and I would like to add a cocos2D game in one of those tabs. Is there any way to integrate it without reprograming all in cocos2d?

Thanks


Solution

  • CCDirector has a property named openGLView. This is the view where Cocos2D renders everything. You could create your own EAGLView (which is a subclass of UIView), add it as a subview to your tab view and make Cocos2D render your scene into this view.