cocos2d as part of a larger iphone app?
Is it possible to have cocos2d as part of a larger app? Say I had 4 tabs in an app, the first 3 开发者_开发技巧were just regular UIKit stuff. Could I somehow put a cocos2d game in the 4th tab? How?
It shouldn't be a problem. Looking at how Cocos2d are making a game view, I found this in my appdelegate:
[viewController setView:glView];
[window addSubview: viewController.view];
I would just guess that you would have to make a viewcontroller for your game, and plain old Apple-style views for the others.
Good luck! Please post here if you get it to work!
(Remember that it calls "viewController.wantsFullScreenLayout = YES;" in the AppDelegate, so this would hide your tab bar. Make a quit option or set view-rect)
精彩评论