I think I know where your issues are originating. pixelheight and pixelWidth don’t change when the orientation changes. In other words it’s the actual pixelWidth and pixelHeight of the device. Remember Corona SDK’s config.lua is always treated as a portrait app.
You need to forget that display.actualContentXXX and display.contentXXX exist when calculating the scale factor for our dynamic images. Lets forget your config.lua for a second and consider this simple one:
application = { content = { width = 800, height = 1200, scale = "letterbox", -- note should be all lower case! fps = 60, imageSuffix = { ["@2x"] = 1.3, }, }, }
Your app’s output for display.contentWidth will be 800. That’s what you set it too. Same for display.contentHeight, it will be 1200. Now for the S3 skin because it’s more of a HDTV shape screen (16:9) vs. the 3:2 screen you defined at 800 x 1200 (a 4x6 photo shape), the actualContentWidth will be 800, but the longer screen means the display.actualContentHeight will be 1423.
The Moderinzing config.lua attempts to make sure that display.contentHeight matches display.actualContentHeight. That’s what all that math is doing. display.contentHeight and display.actualContentHeight should return the same values (plus a few fractions of a point). Since these four values are needed in your program to be based around orientation of your app, so we flip the values to match the orientation. In other words, you can’t use them to calculate the scaling factor of the device.
So how does this impact picking @2x images. Well if you keep in mind that config.lua is always treated in portrait orientation. So the scale factor we use is
display.pixelWidth / Your defined width, or for the S3: 720 / 800 or 0.9. The S5 is 1080 / 800 or 1.35. And for all intents and purposes this is: display.pixelWidth / display.actualContentWidth, but once you get into main.lua, we’ve flipped the two contentWidth and contentHeight values and you can’t in your app calculate the scale factor unless you take orientation in to factor.
Rob