How to handle iPad resolution?

Hi,

We’ve discussed that currently enableRetinaDisplay is available for iPhone 4 to get the proper resolution, while on Android you are stuck with auto scale if you want to seamlessly support multiple resolutions.
Now my question is how you handle the iPad resolution (which is 1024x768)?
Using retina display doesn’t seam very good as first, it has different aspect ratio, second, it is smaller. Is the image scaled for the iPad’s resolution with letterboxing in the same fashion as it happens now for the Android targets?

Even cocos2d-iphone can not deal with the difference between iphone & ipad.
You had to re-design the artwork, and rewrite the coordinates in the code.

If you want to maintain only one copy of source, the suggestion is to write coordinates like:
sprite1_x = anchor1_x * global_scale + offset_sprite1_x;
sprite1_y = anchor1_y * global_scale + offset_sprite1_y;

Well, while it is kind of funny that you explain it by “even cocos2d-iphone can not deal with the difference between iphone & ipad”, I completely understand your point.
I think I’ll somehow solve the resolution problem by playing with the setContentScaleFactor method (maybe I’ll need some code modifications to cocos as well…).

We have a good way to deal with multi-resolutions in the game. My co-worker write the blog last Friday but it’s still in Chinese. I would try to translate it into English and share the experience in the community.

Sorry, I did not want to criticize your work as you are doing an awesome work here with cocos2d-x, I’m just now totally stucked with thinking how to handle multiple resolutions on multiple devices and OSes the best way.

Oh, I don’t feel the words like something you think :slight_smile:

The resolution depends by the type of your game, so this design cannot written in engine.
But generally speaking, scale the background sprite to cover the fullscreen, and set 3 x 3 = 9 anchor points in the screen, these 9 anchors would be changed between different resolutions, e.g. by #ifdef #else #endif. Your sprites are relative to these 9 points using “x = anchor_x * scale + offset”.
AFAIK, many games maintain only one copy to support both iphone & ipad in this way.