Dynamic image selection (iphone 4s vs ipad air)

Hello,

From the corona simulator, here is what I get:
iphone 4s:
pixel width: 640, scale factor: 2
ipad air:
pixel width: 1536, scale factor: 2

I am using “adaptive” content scaling.

–print(display.pixelWidth / display.actualContentWidth) to get scale factor.

Now, since both have scale factor of 2, solar2d will select @2x suffixed image for both of them. If I have an image that goes from very left to very right of the screen, how long should I make that @2x image when drawing in illustrator, 640px or 1536px so that the image scales nicely to the display?

Thanks

Okay, I figured out that unlike “letterbox” mode, dynamic image selection may not be as straightforward for “adaptive” mode, since both iphone4s and ipad air would pick the same tilemap, although they have massive screen resolution difference. The same would be true for many other high end vs low end device combos.

Thus, I will not be using the built-in dynamic image selection feature, instead when the app starts, I will check the device pixel width and will select a tilemap based on that, hopefully this will work.

Thanks

2 Likes