Jason M wrote:
I’m working on an app that requires a section controlled by UIKit and a small game built in cocos2d-x. Once I’ve opened the EAGLView and called CCApplication::sharedApplication().run();, I’d like to be able to move from the game back to the UIKit section. How can I target the UIView or the UIViewController that instantiated my EAGLView from within the EAGLView? I can use CCDirector::sharedDirector()->getOpenGLView() to get a reference to a CC_GLVIEW, but there are no methods on this object that reference the parent UIView or UIViewController. I’d love to be able to call a method assigned to this UIViewController from within a CCScene’s method in my game.
Any help would be appreciated.
Currently I would like to do the same too to return to previous UIViewController.
I have succeeded in returning back by assign controllerDelegate in EAGLView,
But once I retried a lot of times (from Cocos2DXViewController <-> normal UIViewController),
The touch motion becomes slower to react.
When I return to previous UIViewController, I have killed the CCApplication and restarted each time.
Is there anything that I have not released? (For example any static instance?)
Or is there any better implementation for this?