azerion / phaser-spine

A plugin for Phaser 2 that adds Spine support
MIT License
121 stars 58 forks source link

Added oncomplete signal #54

Closed agoemans closed 7 years ago

agoemans commented 7 years ago

Added onComplete signal which is dispatched when animation ends.

NeoHoffa commented 7 years ago

@agoemans / @AleBles ,

I have a request. Can you also add an onEnd signal as well that gets called when an animation is finished playing completely? The onComplete signal is great, but it gets called each time of the animation is looping.

My current work around is to do the following, but doesn't seem like the best use:

spine.state.tracks[0].onEnd = function() {

}

Or perhaps simply passing true or false to the onComplete signal dispatch to tell if the animation is currently loop or not.

spine.onComplete.add( function(isLooping) {

}, this);

Thoughts? Thanks!

AleBles commented 7 years ago

@NeoHoffa, sure no problem