Dynamic resolution (imageSuffix) on iPad Mini

I am using the following config.lua:

application = { content = { scale = "adaptive", fps = 30, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, } }, }

It works fine for all iOS devices expect the iPad Mini (Corona Simulator). On that device my images were low resolution and then I noticed it was using the it was using @1x images instead of @2x.

Shouldn’t iPad mini use @2x?  

Which iPad mini?  i.e. What resolution?  I’m assuming you mean a recent mini at 1536x2048.

Also, I don’t see what your content resolution is.  You still need to provide that in order for selection of a suffix to work.

https://docs.coronalabs.com/daily/guide/basics/configSettings/index.html#width-height

The content area is defined by the width and height values in config.lua. If you omit or set either of these values to 0, content scaling will not be used.

The iPad Mini available on Corona Simulator, which is set as 768 x 1024.

I tested with and without the content size (320 x 480) and the display.imageSuffix is always returning nil for iPad mini.

In fact, I was under the impression that the content resolution size is ignored when using “adaptive” scaling mode…

 

Have you set a config width/height to verify this on the iPad mini? ** DOH.  You did and I missed the post. * *

I must admit I’m only passingly familiar with “adaptive” scaling, but I have to wonder if that is not also a factor here.  It may be influenced by the physical dimensions of the screen which then may affect the scaling selection.

In any case I’d verify whether this can be fixed/resolved by setting width/height.

Yes, it still loads at 1x

 content = { scale = "adaptive", fps = 30, width = 320, height = 480, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, } },

print(display.imageSuffix, display.contentScaleX, display.contentScaleY ) -- prints: nil 1 1 print( display.contentWidth ) -- prints: 768 (totally ignoring the content size)

Note: I misread your prior post, and didn’t see you said you had tested the width/height.  My bad

Debug Suggestion:  Just for fun try switching to ‘letterbox’ and verify the mechanism works that way.  If it does not, then I suspect something about the simulated device settings.

Questions:

  1. Have you been able to test this on a real iPad mini?  

  2. Just to be clear.  We’re only talking about simulated devices?  If that is the case, I’d open of up the file that specifies the iPad mini and compare it to the iPad settings.  Just for grins.

I’m hoping staff will see this and have better suggestions for you than I have so far. Meanwhile, this has me intrigued and thinking.

PS - If you’re a Windows user look here for the skins:

C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\Skins

iPadMini.lua

Hey.  A quick look at the iPad mini simulated device file shows it as 1024 x 768.  That is the original I belive it will select 1x (nil).

For the resolution.

Try editing the file, and change this:

 screenWidth = 768, screenHeight = 1024,

to this:

 screenWidth = 768\*2, screenHeight = 1024\*2,

The selection should work fine then.

PS - This conversation is a little disconnected and I’m missing some of the points you made above.  Bear with me. :slight_smile:

I’m going to zip it for a bit.  I’m not really helping much and I could actual help more by experimenting on my end.  

Cheers,

Ed

I use 1.5x for my retina and that works on all but iPad.  Apparently on my landscape app this is a “Corona bug” on they way the calculations are done because the device is very wide.  So on my app (480x800) I get retina images showing on iPad2 when they technically shouldn’t and this causes memory issues!

Ignore the simulator as on that iPad2 uses non-retina assets where as the device uses retina assets.  

Confusing huh?

I am back.

@roaminggamer, thanks for trying to help me. To your questions:

  1. No, I don’t have a iPad mini to test it. I will try to run on the iOS Simulator and see what happens…

  2. Yes, I am talking about the Corona Simulator, which uses iPad mini 768 x 1024.  

Your suggestion to change the device settings IMHO does not solve the root issue.  Independently if that resolution is for the iPad mini 1 or not, since it is 768, it should be @2x, since when I use iPhone 4S Simulator (640 x 960) it correctly loads the @2x. (768 > 640). Note that I am talking about absolute pixels here.  

My main concern is if the imageSuffix is buggy… If it is, that problem could happen in more devices than only the iPad mini.

@adrianm, I am not using Landscape.

 

So, I ran the Corona app on the iPad 2 iOS Simulator (which has the same resolution as iPad mini) and it is loading the @1x instead of @2x. So it is not a issue with the Corona simulator itself. 

Could someone from Corona shed some light here?  Shouldn’t a device with 768 px (width) load the @2x?

Adaptive works differently than letterbox and zoomEven.

It assumes that you want objects to be the same physical size on a phone vs. a tablet. Adaptive is 1x at 320x480 on phones and 768x1024 on tablets (using Apple sizes) adjusted for aspect ratio.  You won’t get any 2x assets until your device becomes retina in size, that is 640x and 1536x.  I don’t know if the large iPad Pro will get 4x assets, but the “Plus” phones will be a 3x device.

The Adaptive scaling mode is intended primarily for business apps where the phone view and the tablet view are expected to be radically different. Games generally want to occupy the same real estate on the screen and letterbox or zoomEven are better choices.

Rob

Ok, got it.

How Corona is identifying if the device is a tablet?

I don’t believe we really determine phone vs. tablet. We determine a base content area from the device’s information. For iOS it’s based on 320 points. The iPhone 4/5 will be 320 points wide, the iPhone 6/7 will be 375 points wide and the plus models are 414 points. The iPads are 768 points. 

Android has dpi information so we can compute the width and height from that.

Rob

Thank you for the clarification.

Which iPad mini?  i.e. What resolution?  I’m assuming you mean a recent mini at 1536x2048.

Also, I don’t see what your content resolution is.  You still need to provide that in order for selection of a suffix to work.

https://docs.coronalabs.com/daily/guide/basics/configSettings/index.html#width-height

The content area is defined by the width and height values in config.lua. If you omit or set either of these values to 0, content scaling will not be used.

The iPad Mini available on Corona Simulator, which is set as 768 x 1024.

I tested with and without the content size (320 x 480) and the display.imageSuffix is always returning nil for iPad mini.

In fact, I was under the impression that the content resolution size is ignored when using “adaptive” scaling mode…

 

Have you set a config width/height to verify this on the iPad mini? ** DOH.  You did and I missed the post. * *

I must admit I’m only passingly familiar with “adaptive” scaling, but I have to wonder if that is not also a factor here.  It may be influenced by the physical dimensions of the screen which then may affect the scaling selection.

In any case I’d verify whether this can be fixed/resolved by setting width/height.

Yes, it still loads at 1x

 content = { scale = "adaptive", fps = 30, width = 320, height = 480, imageSuffix = { ["@2x"] = 1.5, ["@3x"] = 2.5, } },

print(display.imageSuffix, display.contentScaleX, display.contentScaleY ) -- prints: nil 1 1 print( display.contentWidth ) -- prints: 768 (totally ignoring the content size)

Note: I misread your prior post, and didn’t see you said you had tested the width/height.  My bad

Debug Suggestion:  Just for fun try switching to ‘letterbox’ and verify the mechanism works that way.  If it does not, then I suspect something about the simulated device settings.

Questions:

  1. Have you been able to test this on a real iPad mini?  

  2. Just to be clear.  We’re only talking about simulated devices?  If that is the case, I’d open of up the file that specifies the iPad mini and compare it to the iPad settings.  Just for grins.

I’m hoping staff will see this and have better suggestions for you than I have so far. Meanwhile, this has me intrigued and thinking.

PS - If you’re a Windows user look here for the skins:

C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\Skins

iPadMini.lua