Skip to content

Commit 6b81bc7

Browse files
committed
added since 3.12.0 in new methods, fixed keywords-spacing issue, renamed 'revert' method to 'reverse'
1 parent 8da8fbe commit 6b81bc7

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/animations/Animation.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ var Animation = new Class({
591591
{
592592
// Repeat (happens before complete)
593593

594-
if(component._reverse && component.forward)
594+
if (component._reverse && component.forward)
595595
{
596596
component.forward = false;
597597
}
@@ -615,6 +615,7 @@ var Animation = new Class({
615615
* Returns the animation last frame.
616616
*
617617
* @method Phaser.Animations.Animation#getLastFrame
618+
* @since 3.12.0
618619
*
619620
* @return {Phaser.Animations.AnimationFrame} component - The Animation Last Frame.
620621
*/
@@ -648,7 +649,7 @@ var Animation = new Class({
648649
}
649650
else if (component.repeatCounter > 0)
650651
{
651-
if(component._reverse && !component.forward)
652+
if (component._reverse && !component.forward)
652653
{
653654
component.currentFrame = this.getLastFrame();
654655
this._updateAndGetNextTick(component, component.currentFrame);
@@ -675,6 +676,7 @@ var Animation = new Class({
675676
* Update Frame and Wait next tick
676677
*
677678
* @method Phaser.Animations.Animation#_updateAndGetNextTick
679+
* @since 3.12.0
678680
*
679681
* @param {Phaser.Animations.AnimationFrame} frame - An Animation frame
680682
*

src/gameobjects/components/Animation.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ var Animation = new Class({
224224
* @name Phaser.GameObjects.Components.Animation#forward
225225
* @type {boolean}
226226
* @default false
227+
* @since 3.12.0
227228
*/
228229
this._reverse = false;
229230

@@ -516,6 +517,7 @@ var Animation = new Class({
516517
*
517518
* @method Phaser.GameObjects.Components.Animation#playReverse
518519
* @fires Phaser.GameObjects.Components.Animation#onStartEvent
520+
* @since 3.12.0
519521
*
520522
* @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager.
521523
* @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call.
@@ -544,6 +546,7 @@ var Animation = new Class({
544546
*
545547
* @method Phaser.GameObjects.Components.Animation#_startAnimation
546548
* @fires Phaser.GameObjects.Components.Animation#onStartEvent
549+
* @since 3.12.0
547550
*
548551
* @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager.
549552
* @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.
@@ -561,7 +564,7 @@ var Animation = new Class({
561564
this.repeatCounter = (this._repeat === -1) ? Number.MAX_VALUE : this._repeat;
562565

563566
anim.getFirstTick(this);
564-
567+
565568
this.isPlaying = true;
566569
this.pendingRepeat = false;
567570

@@ -576,15 +579,16 @@ var Animation = new Class({
576579
},
577580

578581
/**
579-
* Revert an Animation that is already playing on the Game Object.
582+
* Reverse an Animation that is already playing on the Game Object.
580583
*
581-
* @method Phaser.GameObjects.Components.Animation#revert
584+
* @method Phaser.GameObjects.Components.Animation#reverse
585+
* @since 3.12.0
582586
*
583587
* @param {string} key - The string-based key of the animation to play, as defined previously in the Animation Manager.
584588
*
585589
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
586590
*/
587-
revert: function (key)
591+
reverse: function (key)
588592
{
589593
if (!this.isPlaying || this.currentAnim.key !== key) { return this.parent; }
590594
this._reverse = !this._reverse;

0 commit comments

Comments
 (0)