Skip to content

Commit 348306c

Browse files
committed
Lots more jsdoc fixes and new documentation
1 parent 4f6f6ee commit 348306c

17 files changed

Lines changed: 117 additions & 82 deletions

File tree

src/animations/Animation.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var GetValue = require('../utils/object/GetValue');
3030
*
3131
* @param {Phaser.Animations.AnimationManager} manager - A reference to the global Animation Manager
3232
* @param {string} key - The unique identifying string for this animation.
33-
* @param {Phaser.Animations.Animation.Config} config - The Animation configuration.
33+
* @param {Phaser.Animations.Types.Animation} config - The Animation configuration.
3434
*/
3535
var Animation = new Class({
3636

@@ -224,7 +224,7 @@ var Animation = new Class({
224224
* @method Phaser.Animations.Animation#addFrame
225225
* @since 3.0.0
226226
*
227-
* @param {(string|Phaser.Animations.AnimationFrame.Config[])} config - [description]
227+
* @param {(string|Phaser.Animations.Types.AnimationFrame[])} config - [description]
228228
*
229229
* @return {Phaser.Animations.Animation} This Animation object.
230230
*/
@@ -240,7 +240,7 @@ var Animation = new Class({
240240
* @since 3.0.0
241241
*
242242
* @param {integer} index - The index to insert the frame at within the animation.
243-
* @param {(string|Phaser.Animations.AnimationFrame.Config[])} config - [description]
243+
* @param {(string|Phaser.Animations.Types.AnimationFrame[])} config - [description]
244244
*
245245
* @return {Phaser.Animations.Animation} This Animation object.
246246
*/
@@ -353,7 +353,7 @@ var Animation = new Class({
353353
* @since 3.0.0
354354
*
355355
* @param {Phaser.Textures.TextureManager} textureManager - [description]
356-
* @param {(string|Phaser.Animations.AnimationFrame.Config[])} frames - [description]
356+
* @param {(string|Phaser.Animations.Types.AnimationFrame[])} frames - [description]
357357
* @param {string} [defaultTextureKey] - [description]
358358
*
359359
* @return {Phaser.Animations.AnimationFrame[]} [description]

src/animations/typedefs/Animation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/**
2-
* @typedef {object} Phaser.Animations.Animation.Config
2+
* @typedef {object} Phaser.Animations.Types.Animation
33
*
44
* @property {string} [key] - The key that the animation will be associated with. i.e. sprite.animations.play(key)
5-
* @property {Phaser.Animations.AnimationFrame.Config[]} [frames] - An object containing data used to generate the frames for the animation
5+
* @property {Phaser.Animations.Types.AnimationFrame[]} [frames] - An object containing data used to generate the frames for the animation
66
* @property {string} [defaultTextureKey=null] - The key of the texture all frames of the animation will use. Can be overridden on a per frame basis.
77
* @property {integer} [frameRate] - The frame rate of playback in frames per second (default 24 if duration is null)
88
* @property {integer} [duration] - How long the animation should play for in milliseconds. If not given its derived from frameRate.

src/animations/typedefs/AnimationFrame.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {object} Phaser.Animations.AnimationFrame.Config
2+
* @typedef {object} Phaser.Animations.Types.AnimationFrame
33
*
44
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
55
* @property {(string|number)} frame - [description]

src/animations/typedefs/JSONAnimation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* @typedef {object} JSONAnimation
2+
* @typedef {object} Phaser.Animations.Types.JSONAnimation
33
*
44
* @property {string} key - The key that the animation will be associated with. i.e. sprite.animations.play(key)
55
* @property {string} type - A frame based animation (as opposed to a bone based animation)
6-
* @property {JSONAnimationFrame[]} frames - [description]
6+
* @property {Phaser.Animations.Types.JSONAnimationFrame[]} frames - [description]
77
* @property {integer} frameRate - The frame rate of playback in frames per second (default 24 if duration is null)
88
* @property {integer} duration - How long the animation should play for in milliseconds. If not given its derived from frameRate.
99
* @property {boolean} skipMissedFrames - Skip frames if the time lags, or always advanced anyway?

src/animations/typedefs/JSONAnimationFrame.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @typedef {object} Phaser.Animations.AnimationFrame.JSONConfig
2+
* @typedef {object} Phaser.Animations.Types.JSONAnimationFrame
33
*
44
* @property {string} key - The key of the Texture this AnimationFrame uses.
55
* @property {(string|integer)} frame - The key of the Frame within the Texture that this AnimationFrame uses.

src/animations/typedefs/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @author Richard Davey <rich@photonstorm.com>
3+
* @copyright 2019 Photon Storm Ltd.
4+
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5+
*/
6+
7+
/**
8+
* @namespace Phaser.Animations.Types
9+
*/

src/display/color/Interpolate.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,29 @@
77
var Linear = require('../../math/Linear');
88

99
/**
10-
* Interpolates color values
11-
*
12-
* @namespace Phaser.Display.Color.Interpolate
10+
* @namespace Phaser.Display.Color.InterpolateFunctions
11+
*/
12+
13+
/**
14+
* @name Phaser.Display.Color.Interpolate
15+
* @memberof Phaser.Display.Color
16+
* @type {Phaser.Display.Color.InterpolateObject}
17+
* @static
1318
* @since 3.0.0
1419
*/
1520

21+
/**
22+
* @typedef {object} Phaser.Display.Color.InterpolateObject
23+
*
24+
* @property {Phaser.Display.Color.InterpolateFunctions.RGBWithRGB} RGBWithRGB - Interpolates between the two given color ranges over the length supplied.
25+
* @property {Phaser.Display.Color.InterpolateFunctions.ColorWithColor} ColorWithColor - Interpolates between the two given color objects over the length supplied.
26+
* @property {Phaser.Display.Color.InterpolateFunctions.ColorWithRGB} ColorWithRGB - Interpolates between the Color object and color values over the length supplied.
27+
*/
28+
1629
/**
1730
* Interpolates between the two given color ranges over the length supplied.
1831
*
19-
* @function Phaser.Display.Color.Interpolate.RGBWithRGB
32+
* @function Phaser.Display.Color.InterpolateFunctions.RGBWithRGB
2033
* @since 3.0.0
2134
*
2235
* @param {number} r1 - Red value.
@@ -47,7 +60,7 @@ var RGBWithRGB = function (r1, g1, b1, r2, g2, b2, length, index)
4760
/**
4861
* Interpolates between the two given color objects over the length supplied.
4962
*
50-
* @function Phaser.Display.Color.Interpolate.ColorWithColor
63+
* @function Phaser.Display.Color.InterpolateFunctions.ColorWithColor
5164
* @since 3.0.0
5265
*
5366
* @param {Phaser.Display.Color} color1 - The first Color object.
@@ -68,7 +81,7 @@ var ColorWithColor = function (color1, color2, length, index)
6881
/**
6982
* Interpolates between the Color object and color values over the length supplied.
7083
*
71-
* @function Phaser.Display.Color.Interpolate.ColorWithRGB
84+
* @function Phaser.Display.Color.InterpolateFunctions.ColorWithRGB
7285
* @since 3.0.0
7386
*
7487
* @param {Phaser.Display.Color} color1 - The first Color object.

src/display/color/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
*/
1515

1616
/**
17-
* @typedef {Object} ColorObject
17+
* @typedef {object} ColorObject
18+
*
1819
* @property {number} r - The red color value in the range 0 to 255.
1920
* @property {number} g - The green color value in the range 0 to 255.
2021
* @property {number} b - The blue color value in the range 0 to 255.

src/display/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ module.exports = {
1515
Canvas: require('./canvas'),
1616
Color: require('./color'),
1717
Masks: require('./mask')
18-
18+
1919
};

src/gameobjects/blitter/Blitter.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ var GameObject = require('../GameObject');
1313
var List = require('../../structs/List');
1414

1515
/**
16-
* @callback Phaser.GameObjects.Blitter.CreateCallback
16+
* @callback CreateCallback
1717
*
1818
* @param {Phaser.GameObjects.Blitter.Bob} bob - The Bob that was created by the Blitter.
1919
* @param {integer} index - The position of the Bob within the Blitter display list.
2020
*/
2121

22+
/**
23+
* @namespace [Phaser.GameObjects.Blitter] Phaser.GameObjects.Blitter
24+
*/
25+
2226
/**
2327
* @classdesc
2428
* A Blitter Game Object.
@@ -167,7 +171,7 @@ var Blitter = new Class({
167171
* @method Phaser.GameObjects.Blitter#createFromCallback
168172
* @since 3.0.0
169173
*
170-
* @param {Phaser.GameObjects.Blitter.CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob.
174+
* @param {CreateCallback} callback - The callback to invoke after creating a bob. It will be sent two arguments: The Bob and the index of the Bob.
171175
* @param {integer} quantity - The quantity of Bob objects to create.
172176
* @param {(string|integer|Phaser.Textures.Frame|string[]|integer[]|Phaser.Textures.Frame[])} [frame] - The Frame the Bobs will use. It must be part of the Blitter Texture.
173177
* @param {boolean} [visible=true] - Should the created Bob render or not?

0 commit comments

Comments
 (0)