Auto scaling on different devices

Hi

I am new to corona sdk and was hoping I can finally get this issue fixed as I have been struggling with it. Basically, I have this piece of code that changes background image color but I want to replace that with a png image file that has some graphics in it.

Current Code:

        local background = display.newRect(0,0,320,480)

        background:setFillColor(255/255,165/255,0/255)

        background.anchorX,background.anchorY = 0,0

My problem is what do I need to do to ensure the background image is scaled correctly on the different iphone and android devices. Do i need to create multiple background images for the different phone sizes or is there a better way of doing this without consuming the device memory.

Thanks

Hi @sysads,

If you want to use different images for different resolutions, for example high-res images for HD/Retina screens and “normal” images for other screens, the proper method is Dynamic Image Selection. The following guide describes how to do this:

http://docs.coronalabs.com/guide/basics/configSettings/index.html#dynamicimages

Take care,

Brent

Thanks  :D, I was able to do it and now on Google Play

https://play.google.com/store/apps/details?id=com.twodgamearena.speedtap

Hi @sysads,

If you want to use different images for different resolutions, for example high-res images for HD/Retina screens and “normal” images for other screens, the proper method is Dynamic Image Selection. The following guide describes how to do this:

http://docs.coronalabs.com/guide/basics/configSettings/index.html#dynamicimages

Take care,

Brent

Thanks  :D, I was able to do it and now on Google Play

https://play.google.com/store/apps/details?id=com.twodgamearena.speedtap