mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 05:03:37 +00:00
Added a reverseOnce method.
This commit is contained in:
parent
b0c4f3bc4c
commit
d4636e9e81
1 changed files with 13 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue