I am working on an ArchViz type application using cocos2d v3 for 2d work and cocos3d for 3d visualization.
I am struggling to find how to find the center of the content in a layer. The user is able to draw the walls of a room with their finger and scroll around to add new walls if they are larger than the viewable screen size. All of this functionality works correctly.
The end result I am looking for is scaling the layer and centering the content so that it is all viewable. My idea was to find the center of the content and scale/move to the center of the screen. The bounding box for the layer seems to start at the origin of the layer (0,0) while the actual nodes and sprite could be anywhere in the layer so I am struggling with finding the right center of the content and NOT the layer.
I found other examples of how to center the camera to a point but without finding the center of the content I am having issues. Any tips or ideas?