Hi,
I have a very simple, newbie question… if i have in my .lua file the following:
local myImage = display.newImageRect("myImage.png", sW,sH,true); myImage.x=sW/2; myImage.y=sH/2
Later, in that same .lua file, I want to switch the graphic - but still using the same variable name of “myImage” - to another graphic, say, myImage2.png how do i change it? Or do i have to use a spritesheet for this? I’m trying to avoid 1) using spritesheet because potentially the size of it may get too large to support (because of ipad retina size and the graphic fills the whole screen) and 2 )trying to avoid creating a new variable in the file like “local myImage2 = display.new…”
Is there something similar to for example changing text, where you can use:
myText.text="This is my new text."
Is there something similar but for graphic objects? I gather i can’t do this:
myImage = display.newImageRect("myImage2.png", sW,sH,true)
In this case, i want to avoid spritesheets, any ideas? I couldn’t find anything on Google search or the docs.
Thanks