I want to run a cocos2D scene on a UIView, called camera_view.
So I try adding the camera_view to the openGLView :
[[CCDirector sharedDirector].openGLView addSubview:cameraView];
And then push my scene, called scene :
[[CCDirector sharedDirector] pushScene: scene];
But after doing that, I can only see the UIView, and the cocos2D scene is no longer visible. However, before adding the camera_view as a subview of the openGLView, the scene was working absolutely fine.
How can I fix this issue ?
Thanks.
My solution is as follows :
I added my camera_view and the openGLView, each as a subview of the UIWindow :
Then I pushed the cocos2D scene :
And that solved the problem. Now I can view the cocos2D scene on my UIView.