Hi,
Just want to know how to transition from a cocos2d scene to a UIviewcontroller view and vice-versa?
thanks, mark
Hi,
Just want to know how to transition 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 )