Hello, I’m on making a new 2D game with Cocos2d-x using C++. My game scene has a large space and it’s need a camera to move around it. But I can’t use just default scene camera, 'cause so-called UILayer will be affected by moving camera. So it’s necessary to add another one. I’ve read a lot of topics about using cameras and knowed out that it’s better to use default scene camera as immovable “UI camera” and create another one to move around game world. Moreover, I can subclass second camera and set up it the way i like it.
However, here comes a problem. When I use default camera as “world camera” sprites, which are gone outside the screen are not drawn. Draw calls and verticed match the number of sprites right at the moment on the screen. That’s good! But I can’t subclass default scene camera, cause’ it was automatically created by the scene. So I can’t customize it.
Okay, let’s use custom camera. It turned out, that when using custom camera as “world camera” sprites that are out of the screen don’t reduce draw calls and vertices!!! So it will draw whole my large world every frame!!!
I read and searched over lots of cocos2d-x source files but didn’t find the solution!
I need your help! How can I reduce draw calls using custom camera?
I’ll be very grateful for your help!!! )