Skip to content

Commit 40689d1

Browse files
committed
Updated jsdocs.
1 parent 8ae9580 commit 40689d1

96 files changed

Lines changed: 1348 additions & 1121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/animations/Animation.js

Lines changed: 111 additions & 108 deletions
Large diffs are not rendered by default.

src/animations/AnimationFrame.js

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,72 @@
11
var Class = require('../utils/Class');
22

3+
/**
4+
* @classdesc
5+
* A single frame in an Animation sequence.
6+
*
7+
* An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other
8+
* frames in the animation, and index data. It also has the ability to fire its own `onUpdate` callback
9+
* and modify the animation timing.
10+
*
11+
* AnimationFrames are generated automatically by the Animation class.
12+
*
13+
* @class AnimationFrame
14+
* @memberOf Phaser.Animations
15+
* @constructor
16+
* @since 3.0.0
17+
*
18+
* @param {string} textureKey - The key of the Texture this AnimationFrame uses.
19+
* @param {string|integer} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses.
20+
* @param {integer} index - The index of this AnimationFrame within the Animation sequence.
21+
* @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering.
22+
*/
323
var AnimationFrame = new Class({
424

525
initialize:
626

7-
/**
8-
* A single frame in an Animation sequence.
9-
*
10-
* An AnimationFrame consists of a reference to the Texture it uses for rendering, references to other
11-
* frames in the animation, and index data. It also has the ability to fire its own `onUpdate` callback
12-
* and modify the animation timing.
13-
*
14-
* AnimationFrames are generated automatically by the Animation class.
15-
*
16-
* @class AnimationFrame
17-
* @memberOf Phaser.Animations
18-
* @constructor
19-
* @since 3.0.0
20-
*
21-
* @param {string} textureKey - The key of the Texture this AnimationFrame uses.
22-
* @param {string|integer} textureFrame - The key of the Frame within the Texture that this AnimationFrame uses.
23-
* @param {integer} index - The index of this AnimationFrame within the Animation sequence.
24-
* @param {Phaser.Textures.Frame} frame - A reference to the Texture Frame this AnimationFrame uses for rendering.
25-
*/
2627
function AnimationFrame (textureKey, textureFrame, index, frame)
2728
{
2829
/**
2930
* The key of the Texture this AnimationFrame uses.
3031
*
31-
* @property {string} textureKey
32+
* @name Phaser.Animations.AnimationFrame#textureKey
33+
* @type {string}
3234
* @since 3.0.0
3335
*/
3436
this.textureKey = textureKey;
3537

3638
/**
3739
* The key of the Frame within the Texture that this AnimationFrame uses.
3840
*
39-
* @property {string|integer} textureFrame
41+
* @name Phaser.Animations.AnimationFrame#textureFrame
42+
* @type {string|integer}
4043
* @since 3.0.0
4144
*/
4245
this.textureFrame = textureFrame;
4346

4447
/**
4548
* The index of this AnimationFrame within the Animation sequence.
4649
*
47-
* @property {integer} index
50+
* @name Phaser.Animations.AnimationFrame#index
51+
* @type {integer}
4852
* @since 3.0.0
4953
*/
5054
this.index = index;
5155

5256
/**
5357
* A reference to the Texture Frame this AnimationFrame uses for rendering.
5458
*
55-
* @property {Phaser.Textures.Frame} frame
59+
* @name Phaser.Animations.AnimationFrame#frame
60+
* @type {Phaser.Textures.Frame}
5661
* @since 3.0.0
5762
*/
5863
this.frame = frame;
5964

6065
/**
6166
* Is this the first frame in an animation sequence?
6267
*
63-
* @property {boolean} isFirst
68+
* @name Phaser.Animations.AnimationFrame#isFirst
69+
* @type {boolean}
6470
* @default false
6571
* @readOnly
6672
* @since 3.0.0
@@ -70,7 +76,8 @@ var AnimationFrame = new Class({
7076
/**
7177
* Is this the last frame in an animation sequence?
7278
*
73-
* @property {boolean} isLast
79+
* @name Phaser.Animations.AnimationFrame#isLast
80+
* @type {boolean}
7481
* @default false
7582
* @readOnly
7683
* @since 3.0.0
@@ -80,7 +87,8 @@ var AnimationFrame = new Class({
8087
/**
8188
* A reference to the AnimationFrame that comes before this one in the animation, if any.
8289
*
83-
* @property {?Phaser.Animations.AnimationFrame} prevFrame
90+
* @name Phaser.Animations.AnimationFrame#prevFrame
91+
* @type {?Phaser.Animations.AnimationFrame}
8492
* @default null
8593
* @readOnly
8694
* @since 3.0.0
@@ -90,7 +98,8 @@ var AnimationFrame = new Class({
9098
/**
9199
* A reference to the AnimationFrame that comes after this one in the animation, if any.
92100
*
93-
* @property {?Phaser.Animations.AnimationFrame} nextFrame
101+
* @name Phaser.Animations.AnimationFrame#nextFrame
102+
* @type {?Phaser.Animations.AnimationFrame}
94103
* @default null
95104
* @readOnly
96105
* @since 3.0.0
@@ -101,7 +110,8 @@ var AnimationFrame = new Class({
101110
* Additional time (in ms) that this frame should appear for during playback.
102111
* The value is added onto the msPerFrame set by the animation.
103112
*
104-
* @property {number} duration
113+
* @name Phaser.Animations.AnimationFrame#duration
114+
* @type {number}
105115
* @default 0
106116
* @since 3.0.0
107117
*/
@@ -111,7 +121,8 @@ var AnimationFrame = new Class({
111121
* What % through the animation does this frame come?
112122
* This value is generated when the animation is created and cached here.
113123
*
114-
* @property {number} progress
124+
* @name Phaser.Animations.AnimationFrame#progress
125+
* @type {number}
115126
* @default 0
116127
* @readOnly
117128
* @since 3.0.0
@@ -121,7 +132,8 @@ var AnimationFrame = new Class({
121132
/**
122133
* A frame specific callback, invoked if this frame gets displayed and the callback is set.
123134
*
124-
* @property {?function} onUpdate
135+
* @name Phaser.Animations.AnimationFrame#onUpdate
136+
* @type {?function}
125137
* @default null
126138
* @since 3.0.0
127139
*/

src/animations/AnimationManager.js

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,90 @@ var EventEmitter = require('eventemitter3');
55
var GetValue = require('../utils/object/GetValue');
66
var Pad = require('../utils/string/Pad');
77

8-
// Animations are managed by the global AnimationManager. This is a singleton class that is
9-
// responsible for creating and delivering animations and their corresponding data to all Game Objects.
10-
// Sprites and other Game Objects get the data they need from the AnimationManager.
11-
// Access it via `scene.anims`.
12-
8+
/**
9+
* @classdesc
10+
* The Animation Manager.
11+
*
12+
* Animations are managed by the global Animation Manager. This is a singleton class that is
13+
* responsible for creating and delivering animations and their corresponding data to all Game Objects.
14+
* Unlike plugins it is owned by the Game instance, not the Scene.
15+
*
16+
* Sprites and other Game Objects get the data they need from the AnimationManager.
17+
*
18+
* @class AnimationManager
19+
* @memberOf Phaser.Animations
20+
* @constructor
21+
* @since 3.0.0
22+
*
23+
* @param {Phaser.Game} game - [description]
24+
*/
1325
var AnimationManager = new Class({
1426

1527
Extends: EventEmitter,
1628

1729
initialize:
1830

19-
/**
20-
* [description]
21-
*
22-
* @class AnimationManager
23-
* @memberOf Phaser.Animations
24-
* @constructor
25-
* @since 3.0.0
26-
*
27-
* @param {Phaser.Game} game - [description]
28-
*/
2931
function AnimationManager (game)
3032
{
3133
EventEmitter.call(this);
3234

3335
/**
3436
* [description]
3537
*
36-
* @property {Phaser.Game} game
38+
* @name Phaser.Animations.AnimationManager#game
39+
* @type {Phaser.Game}
3740
* @protected
41+
* @since 3.0.0
3842
*/
3943
this.game = game;
4044

4145
/**
4246
* [description]
4347
*
44-
* @property {[type]} textureManager
48+
* @name Phaser.Animations.AnimationManager#textureManager
49+
* @type {Phaser.Textures.TextureManager}
4550
* @protected
51+
* @since 3.0.0
4652
*/
4753
this.textureManager = null;
4854

4955
/**
5056
* [description]
5157
*
52-
* @property {number} [globalTimeScale=1]
58+
* @name Phaser.Animations.AnimationManager#globalTimeScale
59+
* @type {number}
60+
* @default 1
61+
* @since 3.0.0
5362
*/
5463
this.globalTimeScale = 1;
5564

5665
/**
5766
* [description]
5867
*
59-
* @property {Phaser.Structs.Map} anims
68+
* @name Phaser.Animations.AnimationManager#anims
69+
* @type {Phaser.Structs.Map}
6070
* @protected
71+
* @since 3.0.0
6172
*/
6273
this.anims = new CustomMap();
6374

6475
/**
6576
* [description]
6677
*
67-
* @property {boolean} [paused=false]
78+
* @name Phaser.Animations.AnimationManager#paused
79+
* @type {boolean}
80+
* @default false
81+
* @since 3.0.0
6882
*/
6983
this.paused = false;
7084

85+
/**
86+
* [description]
87+
*
88+
* @name Phaser.Animations.AnimationManager#name
89+
* @type {string}
90+
* @since 3.0.0
91+
*/
7192
this.name = 'AnimationManager';
7293

7394
game.events.once('boot', this.boot, this);
@@ -78,8 +99,6 @@ var AnimationManager = new Class({
7899
*
79100
* @method Phaser.Animations.AnimationManager#boot
80101
* @since 3.0.0
81-
*
82-
* @param {[type]} textureManager - [description]
83102
*/
84103
boot: function ()
85104
{
@@ -98,7 +117,7 @@ var AnimationManager = new Class({
98117
* @param {string} key - [description]
99118
* @param {Phaser.Animations.Animation} animation - [description]
100119
*
101-
* @return {Phaser.Animations.AnimationManager} The Animation Manager for method chaining.
120+
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
102121
*/
103122
add: function (key, animation)
104123
{
@@ -384,7 +403,7 @@ var AnimationManager = new Class({
384403
* @fires PauseAllAnimationEvent
385404
* @since 3.0.0
386405
*
387-
* @return {Phaser.Animations.AnimationManager} The Animation Manager for method chaining.
406+
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
388407
*/
389408
pauseAll: function ()
390409
{
@@ -407,7 +426,7 @@ var AnimationManager = new Class({
407426
* @param {string} key - [description]
408427
* @param {Phaser.GameObjects.GameObject} child - [description]
409428
*
410-
* @return {Phaser.Animations.AnimationManager} The Animation Manager for method chaining.
429+
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
411430
*/
412431
play: function (key, child)
413432
{
@@ -463,7 +482,7 @@ var AnimationManager = new Class({
463482
* @fires ResumeAllAnimationEvent
464483
* @since 3.0.0
465484
*
466-
* @return {Phaser.Animations.AnimationManager} The Animation Manager for method chaining.
485+
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
467486
*/
468487
resumeAll: function ()
469488
{
@@ -487,7 +506,7 @@ var AnimationManager = new Class({
487506
* @param {Phaser.GameObjects.GameObject} child - [description]
488507
* @param {number} [stagger=0] - [description]
489508
*
490-
* @return {Phaser.Animations.AnimationManager} The Animation Manager for method chaining.
509+
* @return {Phaser.Animations.AnimationManager} This Animation Manager.
491510
*/
492511
staggerPlay: function (key, child, stagger)
493512
{

src/animations/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66

77
Animation: require('./Animation'),
88
AnimationFrame: require('./AnimationFrame'),
9-
AnimationManager: require('./AnimationManager'),
9+
AnimationManager: require('./AnimationManager')
1010

1111
};

src/boot/Config.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,21 +81,22 @@ var ValueToColor = require('../display/color/ValueToColor');
8181
* @property {string} [images.missing] - [description]
8282
*/
8383

84+
/**
85+
* @classdesc
86+
* [description]
87+
*
88+
* @class Config
89+
* @memberOf Phaser.Boot
90+
* @constructor
91+
* @since 3.0.0
92+
*
93+
* @param {object} [GameConfig] - The configuration object for your Phaser Game instance.
94+
*
95+
*/
8496
var Config = new Class({
8597

8698
initialize:
8799

88-
/**
89-
* [description]
90-
*
91-
* @class Config
92-
* @memberOf Phaser.Boot
93-
* @constructor
94-
* @since 3.0.0
95-
*
96-
* @param {object} [GameConfig] - The configuration object for your Phaser Game instance.
97-
*
98-
*/
99100
function Config (config)
100101
{
101102
if (config === undefined) { config = {}; }

0 commit comments

Comments
 (0)