Added a reverseOnce method.

This commit is contained in:
gotenxds 2016-05-27 17:58:54 +03:00
parent b0c4f3bc4c
commit d4636e9e81

View file

@ -252,6 +252,19 @@ Phaser.Animation.prototype = {
this.reversed = !this.reversed;
},
/**
* Reverses the animation direction for the current/next animation only
* Once the onComplete event is called this method will be called again and revert
* the reversed state.
*
* @method Phaser.Animation#reverseOnce
* */
reverseOnce: function () {
this.reverse();
this.onComplete.addOnce(this.reverse.bind(this))
},
/**
* Sets this animations playback to a given frame with the given ID.
*