Of all the awesome features that Corona already has, one core feature of Corona I thought was lacking was the ability to change an existing image.
Currently, there are only three workarounds (at least I’m aware of):
- delete the original image and execute a new display.newImage / display.newImageRect method
- have two images on the ready and change alphas as needed (0,1 and 1,0)
- use spritesheets
I propose a simple solution for those that do not want to go through the hassle of the above, and that’s the ability to simply change an existing image. I don’t mind if it has to be the same dimensions, but it would be nice to be able to replace it with any image of any dimensions on the fly.
local sky = display.newImage( “daytime.png” )
… sometime later…
sky = display.changeImage( “nighttime.png” )
What do you think? [import]uid: 6084 topic_id: 27086 reply_id: 327086[/import]