2

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

k20
  • 2,008
  • 1
  • 17
  • 23

1 Answers1

2

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.

Alexei Sholik
  • 7,287
  • 2
  • 31
  • 41
  • Do you know any tutorial to do that step by step? Any source? Thanks – k20 Mar 22 '11 at 17:16
  • When you create a new project in Xcode from one of the templates provided with Cocos2D, it generates for you well commented code which performs such things as creating an instance of EAGLView, setting up the CCDirector and the root view controller, etc. – Alexei Sholik Mar 24 '11 at 12:25