I guess it depends what you mean by “sprite”.
In Corona SDK, a sprite is just an image hooked up to an imageSheet (an image with multiple images in it). Apart from the fact that you have to initialize the sheet first (and can change frames) it behaves identically to .newImage.
So you have a few options:
- Make it a newSprite to begin with.
i. Create the imageSheet when you launch the program
ii. Make newSprite() instead of newImage()
iii. Change frames using :setFrame()
- Make a function to fake the switch.
i. Create the imageSheet when you launch the program
ii. Function step 1: Record the position and image name of the newImage()
iii. Create a new sprite using the imageSheet and the details you recorded
iv. display.remove() the newImage()
The actual method of making a sprite works like this:
-- 1. Make the imageSheet. It can be a single image if you want; it's just any png local options = {} -- this has to be details describing what's in the image, like number of frames, image size, etc local mySheet = graphics.newImageSheet( "myImage.png", options ) -- 2. Now, anywhere that the imagesheet can be "seen" by the code, you can make sprites from it. local sequence = {} -- this describes the frame order local coolSprite = display.newSprite(mySheet, sequence)
If you need any help with sequences or options, it’s easy for us to help, just need to know the exact issue. 