66
77var Class = require ( '../../utils/Class' ) ;
88
9+ /**
10+ * This event is dispatched when an animation starts playing.
11+ *
12+ * @event Phaser.GameObjects.Components.Animation#onStartEvent
13+ * @param {Phaser.Animations.Animation } animation - Reference to the currently playing animation.
14+ * @param {Phaser.Animations.AnimationFrame } frame - Reference to the current Animation Frame.
15+ */
16+
17+ /**
18+ * This event is dispatched when an animation repeats.
19+ *
20+ * @event Phaser.GameObjects.Components.Animation#onRepeatEvent
21+ * @param {Phaser.Animations.Animation } animation - Reference to the currently playing animation.
22+ * @param {Phaser.Animations.AnimationFrame } frame - Reference to the current Animation Frame.
23+ * @param {integer } repeatCount - The number of times this animation has repeated.
24+ */
25+
26+ /**
27+ * This event is dispatched when an animation updates. This happens when the animation frame changes,
28+ * based on the animation frame rate and other factors like timeScale and delay.
29+ *
30+ * @event Phaser.GameObjects.Components.Animation#onUpdateEvent
31+ * @param {Phaser.Animations.Animation } animation - Reference to the currently playing animation.
32+ * @param {Phaser.Animations.AnimationFrame } frame - Reference to the current Animation Frame.
33+ */
34+
35+ /**
36+ * This event is dispatched when an animation completes playing, either naturally or via Animation.stop.
37+ *
38+ * @event Phaser.GameObjects.Components.Animation#onCompleteEvent
39+ * @param {Phaser.Animations.Animation } animation - Reference to the currently playing animation.
40+ * @param {Phaser.Animations.AnimationFrame } frame - Reference to the current Animation Frame.
41+ */
42+
943/**
1044 * @classdesc
1145 * A Game Object Animation Controller.
@@ -443,6 +477,7 @@ var Animation = new Class({
443477 * Plays an Animation on the Game Object that owns this Animation Component.
444478 *
445479 * @method Phaser.GameObjects.Components.Animation#play
480+ * @fires Phaser.GameObjects.Components.Animation#onStartEvent
446481 * @since 3.0.0
447482 *
448483 * @param {string } key - The string-based key of the animation to play, as defined previously in the Animation Manager.
@@ -652,6 +687,7 @@ var Animation = new Class({
652687 * Immediately stops the current animation from playing and dispatches the `animationcomplete` event.
653688 *
654689 * @method Phaser.GameObjects.Components.Animation#stop
690+ * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent
655691 * @since 3.0.0
656692 *
657693 * @return {Phaser.GameObjects.GameObject } The Game Object that owns this Animation Component.
@@ -673,6 +709,7 @@ var Animation = new Class({
673709 * Stops the current animation from playing after the specified time delay, given in milliseconds.
674710 *
675711 * @method Phaser.GameObjects.Components.Animation#stopAfterDelay
712+ * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent
676713 * @since 3.4.0
677714 *
678715 * @param {integer } delay - The number of miliseconds to wait before stopping this animation.
@@ -691,6 +728,7 @@ var Animation = new Class({
691728 * Stops the current animation from playing when it next repeats.
692729 *
693730 * @method Phaser.GameObjects.Components.Animation#stopOnRepeat
731+ * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent
694732 * @since 3.4.0
695733 *
696734 * @return {Phaser.GameObjects.GameObject } The Game Object that owns this Animation Component.
@@ -707,6 +745,7 @@ var Animation = new Class({
707745 * If this frame doesn't exist within the animation it will not stop it from playing.
708746 *
709747 * @method Phaser.GameObjects.Components.Animation#stopOnFrame
748+ * @fires Phaser.GameObjects.Components.Animation#onCompleteEvent
710749 * @since 3.4.0
711750 *
712751 * @param {Phaser.Animations.AnimationFrame } delay - The frame to check before stopping this animation.
@@ -837,6 +876,7 @@ var Animation = new Class({
837876 * Internal frame change handler.
838877 *
839878 * @method Phaser.GameObjects.Components.Animation#updateFrame
879+ * @fires Phaser.GameObjects.Components.Animation#onUpdateEvent
840880 * @private
841881 * @since 3.0.0
842882 *
0 commit comments