application =
{
content =
{
width = 480,
height = 800,
scale = “zoomEven”, imageSuffix =
{
["@2"] =.94,
},
},
}
________________________________________
Using the view options in the emulator
droid screen = 480 x 854
nexus one = 480 x 800
mytouch = 320 480
galaxy = 600 1024
I cannot understand how corona detremines when to use the “@2” image based upon the above values. There are no examples I have found that explain this logic.
[import]uid: 31039 topic_id: 6953 reply_id: 306953[/import]
corona uses the largest image that is SMALLER than the screen its trying to display on - if you set the ratios the same as what your images are. So for example:
Image.png - main image at 480x320
Image-medium - 800x480
Image-large.png -1024 x 768
For a mytouch or 480x320 screen it will use Image.png
for nexus it will use image-medium.png
for droid it will scale down image-large.png
for galaxy is will scale down Image-large.png
If you want different behaviour eg droid to upscale the medium image you can fix the ratio so that say anything below a multiple of 2 can use the medium one. You would then set its ratio to 2
The idea is that the ratio u set is what it matches against regardless of the image size. [import]uid: 8872 topic_id: 6953 reply_id: 24362[/import]
In the emulator view options (emulator) we have the following target screen ratios.
droid screen = 480 x 854 = 1.78
nexus one = 480 x 800 = 1.67
mytouch = 320 480 = 1.50
galaxy = 600 1024 = 1.71
and we have the following image ratios
Image.png -main image at 480x320 = 1.50
Image-medium- 800x480 = 1.67
Image-large.png-1024 x 768 = 1.33
Which ratios are corona comparing and what is the test?
I appreciate your help on this.
[import]uid: 31039 topic_id: 6953 reply_id: 24559[/import]
"The actual image chosen will depend on the current content scale determined by Corona, which is the ratio between the current screen and the base content dimensions defined in config.lua. "
“Corona will then choose the closest matching suffix, defined as the one whose scale is equal to or smaller than the current content scale factor, and then map that image file into the given [rect]”.
I do notice that keeeping all ratios the same, when I change the content scale from zoomEven to zoomStretch, corona does not choose the same image as before. I don’t know if this is intentional, or a bug. [import]uid: 31039 topic_id: 6953 reply_id: 24826[/import]