开发者

how do I transition from a cocos2d scene to a uiviewcontroller view?

开发者 https://www.devze.com 2023-01-17 06:18 出处:网络
Just want to know how to t开发者_如何学JAVAransition from a cocos2d scene to a UIviewcontroller view and vice-versa?

Just want to know how to t开发者_如何学JAVAransition from a cocos2d scene to a UIviewcontroller view and vice-versa?

thanks, mark


Cocos2D lives in a view, specifically a EAGLView (a subclass of UIView) - that it creates.

Transitioning is not as cut and dry as it seems, especially if using one of the built in templates, cocos2d lives in a new UIWindow (that it creates in your "didFinishLaunchingWithOptions:launchOptions" function).

- You have to create a new view based application, and add cocos2d as a subview of that in order for it to work.

The structure would look like this:

UIViewController (A subclass you created)
 --View (iOS makes this by default for your UIViewController)
   -- CocosView (You make this using [UIView initWithFrame:] )
      -- EAGLView (CCDirector creates on init)
   -- Regular UIKit View ( You make this )
0

精彩评论

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