Hey guys I have a object sitting in my tile map for spawn point reference, problem is the -hd version is twice as big as the non -hd version, so going:
(width = width of character getting spawned)
int spawnX = (width/2) + [tilemap spawnX];
Get’s the wrong position when in hd mode, because the tile map is in pixels but cocos2d is in points.
I.E I could test if retina display was supported, but from what I hear thats a bit dodgey.
How can you do this?
Retina display is supported properly on cocos2d v2.0 rc2.
First, make sure to call
[director_ enableRetinaDisplay:YES]in your app launch with all the other cocos2d initialization stuff.Then, use
CC_CONTENT_SCALE_FACTOR() * pointCountto get pixels out of it.There are also other convenience macros defined in the same header as the
CC_CONTENT_SCALE_FACTOR()macro to help you convertCGRects, etc. that are in points to pixels, and vice-versa.