PixiAnimator Class
[PIXI Only] Animator for interacting with Spine animations
Item Index
Methods
Properties
- _animPool static
- _boundUpdate
- _instance static
- _numAnims
- _timelines
- _updateAlias
- captions
- instance static
- soundLib
Methods
_onMovieClipDone
-
timeline
Called when a movie clip is done playing, calls the AnimTimeline's callback if it has one
Parameters:
-
timeline
PixiAnimator.AnimTimeline
_repool
-
timeline
Put an AnimTimeline back into the general pool after it's done playing or has been manually stopped
Parameters:
-
timeline
PixiAnimator.AnimTimeline
_update
-
elapsed
Update each frame
Parameters:
-
elapsed
IntThe time since the last frame
checkSpineForAnimation
-
clip
-
anim
Checks to see if a Spine animation includes a given animation alias
Parameters:
-
clip
PIXI.spineThe spine to search
-
anim
StringThe animation alias to search for
Returns:
Returns true if the animation is found
destroy
()
Destroy this
init
()
static
Initializes the singleton instance of PixiAnimator.
instanceHasAnimation
-
instance
-
anim
Checks to see if a Spine animation includes a given animation alias
Parameters:
-
instance
PIXI.spineThe animation to search. This has to be a Spine animation.
-
anim
StringThe animation alias to search for
Returns:
Returns true if the animation is found
play
-
clip
-
anim
-
[options]
Play a specified animation
Parameters:
-
clip
PIXI.MovieClip | PIXI.SpineThe clip to play
-
anim
String | ArrayDepending on the type of clip, this could be one of several things.
If animating a MovieClip, this should be the array of Textures that is the animation (or null to use the existing array on the clip).
If animating a Spine object:
- If anim is a string it will play that single animation by name.
- If anim is an array of strings it will play as a list of animations (only the last one can loop).
- If anim is an array of objects (with anim, loop, and speed properties) then multiple animations will be played simultaneously. When multiple animations play, animation stops when any non looping animation ends.
-
[options]
Object | Function optionalThe object of optional parameters or onComplete callback function
-
[callback=null]
Function optionalThe function to call once the animation has finished
-
[loop=false]
Bool optionalWhether the animation should loop
-
[speed=1]
Int optionalThe speed at which to play the animation
-
[startTime=0]
Int optionalThe time in milliseconds into the animation to start.
-
[soundData=null]
Object | String optionalData about a sound to sync the animation to, as an alias or in the format {alias:"MyAlias", start:0}. start is the seconds into the animation to start playing the sound. If it is omitted or soundData is a string, it defaults to 0.
-
stop
-
clip
-
doCallback
Stop a clip
Parameters:
-
clip
PIXI.MovieClip | PIXI.SpineThe clip to stop
-
doCallback
BoolWhether the animations callback should be run
stop
()
Stops all current animations
Properties
_animPool
Array
private
static
Stored collection of AnimTimelines. This is internal to PixiAnimator and can't be accessed externally.
_instance
PixiAnimator
private
static
A reference to this instance of PixiAnimator. This is internal to PixiAnimator and can't be accessed externally.
_numAnims
Int
private
The number of animations
_updateAlias
String
private
A string reference to PixiAnimator's update callback so it can be removed in the event that there are no animations to play
soundLib
cloudkid.Audio | cloudkid.Sound
public
The instance of cloudkid.Audio or cloudkid.Sound for playing audio along with animations.