The external movieclip library allows you to create animated sprites from sequences of images, which can be moved around the screen using the same techniques as any other Corona display object.
The movieclip library is an external module, movieclip.lua
, that can be included with your projects and loaded using the require
command.
The movieclip library can be found in the Movieclip
sample project in the SampleCode/Graphics
folder inside of the Corona SDK.
An animation object is returned using a list of images. You can use methods of the returned animation object to control its playback such as play()
, stop()
, and reverse()
.
movieclip.newAnim( frames )
: Creates an animated sprite using an array of image filenames provided in the frames table:myAnimation = movieclip.newAnim{ "1.png", "2.png", "3.png", "4.png", "5.png"}
object:play()
: Starts the animated sprite playing in the forward direction. When the end of the sequence is reached, it repeats from the beginning.object...