Documented most of the Animation component class and some of the Animation class.

This commit is contained in:
Chris Andrew 2018-06-01 13:11:25 +01:00
parent 544daa8d4a
commit cb6077f231
2 changed files with 16 additions and 14 deletions

View file

@ -510,8 +510,8 @@ var Animation = new Class({
* @private * @private
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.GameObjects.Components.Animation} component - [description] * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to load values into.
* @param {integer} startFrame - [description] * @param {integer} startFrame - The start frame of the animation to load.
*/ */
load: function (component, startFrame) load: function (component, startFrame)
{ {
@ -547,7 +547,7 @@ var Animation = new Class({
* *
* @param {float} value - A value between 0 and 1. * @param {float} value - A value between 0 and 1.
* *
* @return {Phaser.Animations.AnimationFrame} [description] * @return {Phaser.Animations.AnimationFrame} The frame closest to the given progress value.
*/ */
getFrameByProgress: function (value) getFrameByProgress: function (value)
{ {
@ -557,12 +557,12 @@ var Animation = new Class({
}, },
/** /**
* [description] * Advance the animation frame.
* *
* @method Phaser.Animations.Animation#nextFrame * @method Phaser.Animations.Animation#nextFrame
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.GameObjects.Components.Animation} component - [description] * @param {Phaser.GameObjects.Components.Animation} component - The Animation Component to advance.
*/ */
nextFrame: function (component) nextFrame: function (component)
{ {

View file

@ -381,8 +381,8 @@ var Animation = new Class({
* @protected * @protected
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} key - [description] * @param {string} key - The key of the animation to load.
* @param {integer} [startFrame=0] - [description] * @param {integer} [startFrame=0] - The start frame of the animation to load.
* *
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
*/ */
@ -549,7 +549,7 @@ var Animation = new Class({
* @method Phaser.GameObjects.Components.Animation#setProgress * @method Phaser.GameObjects.Components.Animation#setProgress
* @since 3.4.0 * @since 3.4.0
* *
* @param {float} [value=0] - [description] * @param {float} [value=0] - The progress value, between 0 and 1.
* *
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
*/ */
@ -610,7 +610,7 @@ var Animation = new Class({
* @method Phaser.GameObjects.Components.Animation#setRepeat * @method Phaser.GameObjects.Components.Animation#setRepeat
* @since 3.4.0 * @since 3.4.0
* *
* @param {integer} value - [description] * @param {integer} value - The number of times that the animation should repeat.
* *
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
*/ */
@ -662,7 +662,7 @@ var Animation = new Class({
* @method Phaser.GameObjects.Components.Animation#restart * @method Phaser.GameObjects.Components.Animation#restart
* @since 3.0.0 * @since 3.0.0
* *
* @param {boolean} [includeDelay=false] - [description] * @param {boolean} [includeDelay=false] - Whether to include the delay value of the animation when restarting.
* *
* @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component. * @return {Phaser.GameObjects.GameObject} The Game Object that owns this Animation Component.
*/ */
@ -812,10 +812,10 @@ var Animation = new Class({
* @method Phaser.GameObjects.Components.Animation#update * @method Phaser.GameObjects.Components.Animation#update
* @since 3.0.0 * @since 3.0.0
* *
* @param {number} timestamp - [description] * @param {number} time - The current timestamp.
* @param {number} delta - The delta time, in ms, elapsed since the last frame. * @param {number} delta - The delta time, in ms, elapsed since the last frame.
*/ */
update: function (timestamp, delta) update: function (time, delta)
{ {
if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused) if (!this.currentAnim || !this.isPlaying || this.currentAnim.paused)
{ {
@ -882,7 +882,7 @@ var Animation = new Class({
* @private * @private
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.Animations.AnimationFrame} animationFrame - [description] * @param {Phaser.Animations.AnimationFrame} animationFrame - The animation frame to change to.
*/ */
updateFrame: function (animationFrame) updateFrame: function (animationFrame)
{ {
@ -941,7 +941,9 @@ var Animation = new Class({
}, },
/** /**
* [description] * Destroy this Animation component.
*
* Unregisters event listeners and cleans up its references.
* *
* @method Phaser.GameObjects.Components.Animation#destroy * @method Phaser.GameObjects.Components.Animation#destroy
* @since 3.0.0 * @since 3.0.0