问题
I have integrated cocos2d 2.0 into an existing iOS project and would like to be able to create a view and add it to an existing view as a subview.
Where should the cocos2d setup code be placed and how is the cocos2d view then made visible inside the UIView?
I have followed Ray Wenderlichs tutorial and it doesn't help with the specific issue. A lot of the code is deprecated as well.
Is it possible to do the cocos2d setup inside the cocos2d class I create? Im not sure on how to connect the CCDirector
and glView
to the current architecture.
If I do the setup in the AppDelegate
, what exactly is needed in the cocos2d view (CCLayer
e.g.) and how is it made visible? The template uses a navigation controller, but I do not use that.
How is the cocos2d view linked to the setup, and who takes care of displaying the view?
来源:https://stackoverflow.com/questions/16938417/adding-a-cocos2d-view-to-a-uiview