config.lua on Android

Whooorayyyy!! Thank you Rob that did the trick.

To make sure I understand.  Using the display.newImage Rect (“Images/borderYellowGreen2.png”,  768, 768 ) identifies the size of the object without question.  Then the using the aspect ratio…in the config.lua (from the tutorial) the corona software resizes the object (table) to fit the device.  

Correct?

Should I update all my objects to be like this even though they are working?

Thanks

Lori

The config.lua’s width and height defines your screen space.

This block of code:

 imageSuffix = { ["@2x"] = 1.5, ["@4x"] = 3.0, },

tells Corona based on the real size of the screen relative to what you defined. So if your screen is higher resolution than 800 x 1200 (the base you’re defining), then it will pick up your @2x or @4x versions of your file.

display.newImage() loads the image in at the size the file’s native dimensions but doesn’t handle content scaling well. You’re better to use newImageRect() because you’re in control over the image size instead of letting images update based on screen dimensions.

Should you go change what’s working? Probably not, but in future endeavours, work towards making display.newImageRect() your goto function when you know the size of the image.

Rob

Thank you so much Rob.  I appreciate your taking the extra time to explain.