To be more clear I provide more information what I’m doing.
This is not a game. It is a library.
I try create library which implements runtime for Spriter (Pro) so you can use in Corona SDK animations created with it. As input it takes *.scon file and images. The scon file provide only key-frames so my library have to calculate transition between them.
Spriter enables the “modular” method of creating silky-smooth animations where key-frames are constructed from small, re-useable images (such as body parts). This method of animating offers many benefits for several aspects of a game’s development and for the finished product.
How animations work in my library?
It is simple. A next frame is formed by changing position/rotation/scale of images from previous frame a little bit. I use the same images. So I don’t need swap images to create motion. More robust explanation with image below.
Note : In general some parts of animation may need image swap but as rule animations are made by modify previous frame.
Work flow of my library (the way it works now)
Load resources like images
I create display objects (display.newImage) and store them in table named resources. Since that all images are visible on the screen now.
Initalize player object. I use it to play/stop/modifiy animation.
Start playing chosen animation. For now the draw( image ) function is called to draw all parts of animation. If animation consist 10 parts it will be called 10 times.
Change or modify animation.
I don’t want show all images at the same time. So one possible solution is make unused images invisible but since this is inefficient I’m looking for better solution. So that is why I come up with use of textures.
This just saved me tons of time that I was dreading spending on a redesign to turn all my images into imagesheets. Fill used to be an enterprise feature, so I forgot about it.