开发者

cocos2d as part of a larger iphone app?

开发者 https://www.devze.com 2023-02-15 01:56 出处:网络
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

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)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号