Issue with Retina Display and Content Scaling

Issue with Retina Display and Content Scaling
0.0 0



I’ve create a multiplatform game. I didn’t use any retina images since all intended resolutions were high, so I didn’t resort to using ‘setContentScaleFactor’ or ‘enableRetinaDisplay’. What I did was simple. I used iPad sized images then scaled everything based on relative size compared to the iPad’s.

This works great with the iPad (obviously) and ALL Android resolutions I could get my hands on and the original iPhone resolution, but it didn’t work in iPhone Retina resolution. It displays normally and all items are placed as I had intended but there is one problem - everything is very pixelated. The problem is getwinsize() and getwinsizeinpixels() both return half the real resolution so all images are scaled by half of what they should be then they are scaled back up again, thus producing the pixelation.

I tried to double the scale factor, use getwinsizeinpixels(), use content scaling and mess around with retina display options, but everything gave me certain types of problems. I just want the iPhone retina to be taken as if it’s an android display, without all the points vs pixels crap.



You have probably solved this already but just in case anyone else has this problem.

You have to enable retina mode by calling


to make cocos2d setup a high resolution view or whatever. If you don’t do this the resolution will be low and everything will be pixelated regardless of the resources used.

Tip: You can test how things look and feel on a non-retina iOS device by disabling this in case you only have a retina device on hand.

Hope this helps. :slight_smile: