I am a bit confused on when to use CC_CONTENT_SCALE_FACTOR() in my app. I use Box2D for collision detection, and I make a b2Body of vertices. Now should I divide each point only by the PTM_Ratio or by the PTM_Ratio multiplied by CC_CONTENT_SCALE_FACTOR()?
Should I be using CC_CONTENT_SCALE_FACTOR() anywhere in my app if I am not dealing with pixels? Should I only use CC_CONTENT_SCALE_FACTOR() for GLESDebugDraw like this?
_debugDraw = new GLESDebugDraw( ptmRatio * CC_CONTENT_SCALE_FACTOR()); ?
Thanks!
The Box2D world doesn’t care in how many pixels it is rendered in. Box2D is completely oblivious to screen resolution, therefore you don’t and shouldn’t scale any content whether you’re on a Retina display device or not.
There’s currently only one aspect where you might need CC_CONTENT_SCALE_FACTOR and that is when working with tilemaps. If I remember correctly, the tileset width and height properties are given in pixels, not points. Therefore you need to divide by CC_CONTENT_SCALE_FACTOR to get the correct size in points. Not sure why that’s not done by cocos2d internally.