A class similar to PIXI.extras.MovieClip, but made to play animations exclusively using the Animator, with data exported by the BitmapMovieClip exporter.
Format for AdvancedMovieClip data (the same as BitmapMovieClip):
{
fps:30,
labels:
{
animStart:0,
animStart_loop:15
},
origin:{ x: 20, y:30 },
frames:
[
{
name:"myAnim#",
min:1,
max:20,
digits:4
}
],
scale:1
}
The example object describes a 30 fps animation that is 20 frames long, and was originally myAnim0001.png->myAnim0020.png, with frame labels on the first and 16th frames. 'digits' is optional, and defaults to 4.
springroll.pixi.AdvancedMovieClip
[data]
[atlas]
[data]
Object
optional
Initialization data
[fps]
Int
optional
Framerate to play the movieclip at. Omitting this will use the current framerate.
[labels]
Object
optional
A dictionary of the labels in the movieclip to assist in playing animations.
[origin={x:0,y:0}]
Object
optional
The origin of the movieclip.
[frames]
Array
optional
An array of frame sequences to pull from the texture atlas.
[name]
String
optional
[min]
Int
optional
[max]
Int
optional
[digits=4]
Int
optional
[scale=1]
Number
optional
The scale at which the art was exported, e.g. a scale of 1.4 means the art was increased in size to 140% before exporting and should be scaled back down before drawing to the screen.
[atlas]
springroll.pixi.TextureAtlas
optional
A TextureAtlas to pull frames from. If omitted, frames are pulled from Pixi's global texture cache.
advance
[time]
Advances the playhead. This occurs automatically each tick by default.
[time]
Number
optional
The amount of time in milliseconds to advance by.
copyFrom
other
Copies the labels, textures, origin, and framerate from another AdvancedMovieClip. The labels and textures are copied by reference, instead of a deep copy.
other
AdvancedMovieClip
The movieclip to copy data from.
getCurrentLabel
Returns the name of the label on or immediately before the current frame.
The name of the current label or null if there is no label.
getEvents
Returns a sorted list of the labels which can be played with Animator.
A sorted array of objects with label, length and position (aka frame) properties.
getLabels
Returns a sorted list of the labels defined on this AdvancedMovieClip.
A sorted array of objects with label and position (aka frame) properties.
init
data
[atlas]
Initializes or re-initializes the AdvancedMovieClip.
data
Object
Initialization data
[fps]
Int
optional
Framerate to play the movieclip at. Omitting this will use the current framerate.
[labels]
Object
optional
A dictionary of the labels in the movieclip to assist in playing animations.
[origin={x:0,y:0}]
Object
optional
The origin of the movieclip.
[frames]
Array
optional
An array of frame sequences to pull from the texture atlas.
[name]
String
optional
[min]
Int
optional
[max]
Int
optional
[digits=4]
Int
optional
[scale=1]
Number
optional
The scale at which the art was exported, e.g. a scale of 1.4 means the art was increased in size to 140% before exporting and should be scaled back down before drawing to the screen.
[atlas]
springroll.pixi.TextureAtlas
optional
A TextureAtlas to pull frames from. If omitted, frames are pulled from Pixi's global texture cache.
elapsedTime
When the BitmapMovieClip is framerate independent, this is the time elapsed from frame 0 in seconds.
Default: 0