Earlier, we touched base with dynamic image resolution. The iOS devices are a perfect example for this case. Corona has the capability to use base images (for devices on the 3GS and lower) and double-resolution images (for the iPhone 4 that has a retina display), all in the same project file. Any of your double-resolution images can be swapped to your high-end iOS device without having to alter your code. This will allow your build to work with older devices and lets you handle more complex multiscreen deployment cases. You will notice that dynamic image resolution works in conjunction with dynamic content scaling.
Using the line, display.newImageRect( [parentGroup,] filename [, baseDirectory] w, h)
, will call out your dynamic resolution images.
Here, w
refers to the content width of the image and h
refers to the content height of the image.
Here is an example:
myImage = display.newImageRect( "image.png", 128, 128 )
Remember that the two values represent the base image...