Universal App - Image/sprite Size And Aspect Ratio

Hi

 

I’m building a universal app for android (phones, tablets) and ios (phones, tablets). I couln’t find a satisfying answer to my question, so I’m posting it here.

 

Is it a good way to start a universal app with the new ipad dimensions (with dynamic scalling)? I’m asking because the ipad has an aspect ratio of 4:3 and the iPhone and android devices are all close to 16:9. Would it then make sense to build one app for the ipad and another for iPhone and android?

 

Since I’ll have a lot of sprites and the file is getting quitie big, I have another question:

If you have images with dynamic scalling (@2, @4)  will corona export all the images if you build an iPad and an iPhone app seperately? Or will it delete the unused images?

 

Thanks!

Anything in the project folder with your .lua files will be compiled, whether they’re referenced or not in your code.  So, you can be prepared for a large final universal binary with @4x.png files that an iPhone 3GS user will never see, but will have to download.  I’m thinking of coming up with a function that will can download @2x and/or @4x files from a server AFTER you’ve download the original binary, and when you attempt to access an image, it will check both directories (the app’s personal storage area and the app’s original files area).

 

The bottom line, it really depends on your target audience.  I’ve always taken the approach of “looking at it from both ends.”

 

I’ll start by assuming I’m coding for an iPad with Retina Display, so I always start with the sharpest graphics possible, which I can always downsample to smaller resolutions for the other devices.  Then, I’ll add code that will help offset any positioning, based on the device it’s running on (iPad at 4:3 aspect ratio, iPhone 5/iPod touch 5G at 16:9 aspect ratio, and all previous iPhones at 3:2 aspect ratio).  Lastly, I’ll add checks in my code to make sure that even the slowest device I intend the app for can run, i.e. taking out certain particle effects, or using less sprites or objects.

I also use a single code base to build universal iOS apps and Android apps.  I have two sets of sound files (aac files for iOS and ogg files for Android), two sets of Default.png files, and two sets of Icon.png files.  I swap them depending on target OS I’m building for.

 

My config.lua is set up with letterbox scaling, 320x480, and imageSuffix of @2x and @4x, but it also detects iPhone5, and would configure 320x568 for it.  All of my images are positioned based on relative distance from display center.  As BeyondtheTech noted, it would be more elegant to reposition the items based on the target device, but I decided, with my app, it wouldn’t make a world of difference.  So I don’t worry about repositioning display objects based on which device the app would run.  

 

My largest image (i.e., the background, landscape) is 570x380, which is 2280x1520 at @4x.  It’s working fine with iOS apps, and it’s been looking fine on Android device I’ve checked so far.

 

Naomi

Anything in the project folder with your .lua files will be compiled, whether they’re referenced or not in your code.  So, you can be prepared for a large final universal binary with @4x.png files that an iPhone 3GS user will never see, but will have to download.  I’m thinking of coming up with a function that will can download @2x and/or @4x files from a server AFTER you’ve download the original binary, and when you attempt to access an image, it will check both directories (the app’s personal storage area and the app’s original files area).

 

The bottom line, it really depends on your target audience.  I’ve always taken the approach of “looking at it from both ends.”

 

I’ll start by assuming I’m coding for an iPad with Retina Display, so I always start with the sharpest graphics possible, which I can always downsample to smaller resolutions for the other devices.  Then, I’ll add code that will help offset any positioning, based on the device it’s running on (iPad at 4:3 aspect ratio, iPhone 5/iPod touch 5G at 16:9 aspect ratio, and all previous iPhones at 3:2 aspect ratio).  Lastly, I’ll add checks in my code to make sure that even the slowest device I intend the app for can run, i.e. taking out certain particle effects, or using less sprites or objects.

I also use a single code base to build universal iOS apps and Android apps.  I have two sets of sound files (aac files for iOS and ogg files for Android), two sets of Default.png files, and two sets of Icon.png files.  I swap them depending on target OS I’m building for.

 

My config.lua is set up with letterbox scaling, 320x480, and imageSuffix of @2x and @4x, but it also detects iPhone5, and would configure 320x568 for it.  All of my images are positioned based on relative distance from display center.  As BeyondtheTech noted, it would be more elegant to reposition the items based on the target device, but I decided, with my app, it wouldn’t make a world of difference.  So I don’t worry about repositioning display objects based on which device the app would run.  

 

My largest image (i.e., the background, landscape) is 570x380, which is 2280x1520 at @4x.  It’s working fine with iOS apps, and it’s been looking fine on Android device I’ve checked so far.

 

Naomi