Apologies if this post is more appropriate in another forum, but I am a newbie to Corona. I have been experimenting with config.lua content settings - especially that provided by Sergey Lalov (corona SDK Pro Tip #36: SmartPixel config.lua). I don’t understand the reported pixel resolutions.
I modified the test program provided by Sergey to add on-screen printing of display.pixel* and display.Content* as well as the display.actualContent* The program displays 70 point white squares at the top left and bottom right of a frame whose size is defined by display.content*
Here are a summary of my results: (I am comparing the results of the Corona Simulator - version 2016.2830 with the program run on an iPhone 6s running IOS 9.3.1). Note everything seems consistent for iPhone 4 and 5 simulations.
-
using the “standard” config.lua settings (content width/height = 320/480), the program gives the expected appearance with letterboxing. The Corona simulator reports display.content* = 320 x 480, display.actualContent 320 x 569 (rounding error??), and display.pixel* = 750 x 1334. All (almost) as expected.
-
Running on my iPhone 6s in standard display mode (and in the Xcode simulator), display.content* = 320x480, display.actualContent = 320 x 568, BUT display.pixel* = 640 x 1136. Note the discrepancy with the Corona simulator. The white squares appear to be the correct physical size as far as I could measure them on the phone screen.
-
Running on my iPhone 6s in zoomed display mode, display.content* = 320x480, display.actualContent = 320 x 568, BUT display.pixel* = 750 x 1331. The white squares are the same size as in the previous use (as expected).
What is going on with the values of display.pixel* ? The rendered pixel density of a 6s phone in standard view was, I thought, 750 x 1334, but that is what is reported in zoomed display mode. Similarly, the rendered pixel density in zoomed display mode is 640 x 1136, but that is what is reported in standard display mode.
Does the fact that what is reported is the “inverse” of what is expected account for the (correct) result that both images in both standard and zoomed modes are the same size? Of course, as far as I can make out, the pixel density shouldn’t be required by any designer, so perhaps it doesn’t matter.
Now the experiment is repeated using Sergey’s config.lua. This determines an optimum content space - I have no idea how IOS determines this at runtime.
-
Using Sergey’s “SmartPixel” config.lua, In the Corona simulator, there is no letterboxing, the layout fills the screen. The Corona simulator reports display.content* = 375 x 667, display.actualContent 375 x 667 , and display.pixel* = 750 x 1334. All as expected.
-
Running on my iPhone 6s in standard display mode (and in the Xcode simulator), display.content* = 320x568, display.actualContent = 320 x 568, BUT display.pixel* = 640 x 1136. Note the discrepancy with the Corona simulator. The white squares appear to be the correct physical size as far as I could measure them on the phone screen.
-
Running on my iPhone 6s in zoomed display mode, display.content* = 375 x 665, display.actualContent = 375 x 665.5, BUT display.pixel* = 750 x 133 1. The white squares are smaller than in this zoomed mode than in standard display mode, but this is consistent with the reported content size being larger than in the standard display mode. Users however, may be puzzled by features being smaller in zoomed mode than in standard mode.
Questions:
a) Why is the reported pixel resolution for standard display mode more appropriate for zoomed display mode and vice versa?
B) Why does the content area differ using Sergey’s SmartPixel config.lua between standard display mode and zoomed display mode?