Skip to content

Commit cb6077f

Browse files
committed
Documented most of the Animation component class and some of the Animation class.
1 parent 544daa8 commit cb6077f

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

src/animations/Animation.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,8 @@ var Animation = new Class({
510510
* @private
511511
* @since 3.0.0
512512
*
513-
* @param {Phaser.GameObjects.Components.Animation} component - [description]
514-
* @param {integer} startFrame - [description]
513+
* @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into.
514+
* @param {integer} startFrame - The start frame of the animation to load.
515515
*/
516516
load: function (component, startFrame)
517517
{
@@ -547,7 +547,7 @@ var Animation = new Class({
547547
*
548548
* @param {float} value - A value between 0 and 1.
549549
*
550-
* @return {Phaser.Animations.AnimationFrame} [description]
550+
* @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value.
551551
*/
552552
getFrameByProgress: function (value)
553553
{
@@ -557,12 +557,12 @@ var Animation = new Class({
557557
},
558558

559559
/**
560-
* [description]
560+
* Advance the animation frame.
561561
*
562562
* @method Phaser.Animations.Animation#nextFrame
563563
* @since 3.0.0
564564
*
565-
* @param {Phaser.GameObjects.Components.Animation} component - [description]
565+
* @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.
566566
*/
567567
nextFrame: function (component)
568568
{

src/gameobjects/components/Animation.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ var Animation = new Class({
381381
* @protected
382382
* @since 3.0.0
383383
*
384-
* @param {string} key - [description]
385-
* @param {integer} [startFrame=0] - [description]
384+
* @param {string} key - The key of the animation to load.
385+
* @param {integer} [startFrame=0] - The start frame of the animation to load.
386386
*
387387
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
388388
*/
@@ -549,7 +549,7 @@ var Animation = new Class({
549549
* @method Phaser.GameObjects.Components.Animation#setProgress
550550
* @since 3.4.0
551551
*
552-
* @param {float} [value=0] - [description]
552+
* @param {float} [value=0] - The progress value, between 0 and 1.
553553
*
554554
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
555555
*/
@@ -610,7 +610,7 @@ var Animation = new Class({
610610
* @method Phaser.GameObjects.Components.Animation#setRepeat
611611
* @since 3.4.0
612612
*
613-
* @param {integer} value - [description]
613+
* @param {integer} value - The number of times that the animation should repeat.
614614
*
615615
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
616616
*/
@@ -662,7 +662,7 @@ var Animation = new Class({
662662
* @method Phaser.GameObjects.Components.Animation#restart
663663
* @since 3.0.0
664664
*
665-
* @param {boolean} [includeDelay=false] - [description]
665+
* @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting.
666666
*
667667
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
668668
*/
@@ -812,10 +812,10 @@ var Animation = new Class({
812812
* @method Phaser.GameObjects.Components.Animation#update
813813
* @since 3.0.0
814814
*
815-
* @param {number} timestamp - [description]
815+
* @param {number} time - The current timestamp.
816816
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
817817
*/
818-
update: function (timestamp, delta)
818+
update: function (time, delta)
819819
{
820820
if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused)
821821
{
@@ -882,7 +882,7 @@ var Animation = new Class({
882882
* @private
883883
* @since 3.0.0
884884
*
885-
* @param {Phaser.Animations.AnimationFrame} animationFrame - [description]
885+
* @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to.
886886
*/
887887
updateFrame: function (animationFrame)
888888
{
@@ -941,7 +941,9 @@ var Animation = new Class({
941941
},
942942

943943
/**
944-
* [description]
944+
* Destroy this Animation component.
945+
*
946+
* Unregisters event listeners and cleans up its references.
945947
*
946948
* @method Phaser.GameObjects.Components.Animation#destroy
947949
* @since 3.0.0

0 commit comments

Comments
 (0)