Skip to content

Commit ce04ade

Browse files
author
Webeled
committed
Lots of JSDocs updates in the gameobjects folder
1 parent 35517d9 commit ce04ade

9 files changed

Lines changed: 74 additions & 87 deletions

File tree

src/gameobjects/BitmapText.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.BitmapText
65
*/
76

87
/**
@@ -12,10 +11,10 @@
1211
* @class Phaser.BitmapText
1312
* @constructor
1413
* @param {Phaser.Game} game - A reference to the currently running game.
15-
* @param {number} x - X position of Description.
16-
* @param {number} y - Y position of Description.
17-
* @param {string} text - Description.
18-
* @param {string} style - Description.
14+
* @param {number} x - X position of the new bitmapText object.
15+
* @param {number} y - Y position of the new bitmapText object.
16+
* @param {string} text - The actual text that will be written.
17+
* @param {object} style - The style object containing style attributes like font, font size , etc.
1918
*/
2019
Phaser.BitmapText = function (game, x, y, text, style) {
2120

src/gameobjects/Bullet.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.Bullet
65
*/
76

87
/**
@@ -15,13 +14,12 @@
1514
* animation, all input events, crop support, health/damage, loadTexture
1615
*
1716
* @class Phaser.Bullet
18-
* @classdesc Description of class.
1917
* @constructor
2018
* @param {Phaser.Game} game - Current game instance.
21-
* @param {Description} x - Description.
22-
* @param {Description} y - Description.
23-
* @param {string} key - Description.
24-
* @param {Description} frame - Description.
19+
* @param {number} x - X position of the new bullet.
20+
* @param {number} y - Y position of the new bullet.
21+
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
22+
* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
2523
*/
2624
Phaser.Bullet = function (game, x, y, key, frame) {
2725

src/gameobjects/Button.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.Button
65
*/
76

87

src/gameobjects/Events.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.Events
65
*/
76

87

src/gameobjects/GameObjectFactory.js

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.GameObjectFactory
65
*/
76

87
/**
@@ -43,8 +42,8 @@ Phaser.GameObjectFactory.prototype = {
4342
/**
4443
* Description.
4544
* @method existing.
46-
* @param {object} - Description.
47-
* @return {boolean} Description.
45+
* @param {*} object - An instance of Phaser.Sprite, Phaser.Button or any other display object..
46+
* @return {*} The child that was added to the Group.
4847
*/
4948
existing: function (object) {
5049

@@ -60,7 +59,7 @@ Phaser.GameObjectFactory.prototype = {
6059
* @param {number} y - Y position of the new sprite.
6160
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
6261
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
63-
* @returns {Description} Description.
62+
* @returns {Phaser.Sprite} the newly created sprite object.
6463
*/
6564
sprite: function (x, y, key, frame) {
6665

@@ -77,7 +76,7 @@ Phaser.GameObjectFactory.prototype = {
7776
* @param {number} y - Y position of the new sprite.
7877
* @param {string|RenderTexture} [key] - The image key as defined in the Game.Cache to use as the texture for this sprite OR a RenderTexture.
7978
* @param {string|number} [frame] - If the sprite uses an image from a texture atlas or sprite sheet you can pass the frame here. Either a number for a frame ID or a string for a frame name.
80-
* @returns {Description} Description.
79+
* @returns {Phaser.Sprite} the newly created sprite object.
8180
*/
8281
child: function (group, x, y, key, frame) {
8382

@@ -102,8 +101,8 @@ Phaser.GameObjectFactory.prototype = {
102101
* Creates a new group to be added on the display list
103102
*
104103
* @method group
105-
* @param {Description} parent - Description.
106-
* @param {Description} name - Description.
104+
* @param {*} parent - The parent Group or DisplayObjectContainer that will hold this group, if any.
105+
* @param {string} [name=group] - A name for this Group. Not used internally but useful for debugging.
107106
* @return {Phaser.Group} The newly created group.
108107
*/
109108
group: function (parent, name) {
@@ -119,7 +118,7 @@ Phaser.GameObjectFactory.prototype = {
119118
* @param {string} key - The Game.cache key of the sound that this object will use.
120119
* @param {number} volume - The volume at which the sound will be played.
121120
* @param {boolean} loop - Whether or not the sound will loop.
122-
* @return {Phaser.Audio} The audio object.
121+
* @return {Phaser.Sound} The newly created text object.
123122
*/
124123
audio: function (key, volume, loop) {
125124

@@ -133,11 +132,11 @@ Phaser.GameObjectFactory.prototype = {
133132
* @method tileSprite
134133
* @param {number} x - X position of the new tileSprite.
135134
* @param {number} y - Y position of the new tileSprite.
136-
* @param {Description} width - the width of the tilesprite.
137-
* @param {Description} height - the height of the tilesprite.
135+
* @param {number} width - the width of the tilesprite.
136+
* @param {number} height - the height of the tilesprite.
138137
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
139-
* @param {Description} frame - Description.
140-
* @return {Description} Description.
138+
* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
139+
* @return {Phaser.TileSprite} The newly created tileSprite object.
141140
*/
142141
tileSprite: function (x, y, width, height, key, frame) {
143142

@@ -153,6 +152,7 @@ Phaser.GameObjectFactory.prototype = {
153152
* @param {number} y - Y position of the new text object.
154153
* @param {string} text - The actual text that will be written.
155154
* @param {object} style - The style object containing style attributes like font, font size , etc.
155+
* @return {Phaser.Text} The newly created text object.
156156
*/
157157
text: function (x, y, text, style) {
158158

@@ -164,14 +164,15 @@ Phaser.GameObjectFactory.prototype = {
164164
* Description.
165165
*
166166
* @method button
167-
* @param {Description} x - Description.
168-
* @param {Description} y - Description.
169-
* @param {Description} callback - Description.
170-
* @param {Description} callbackContext - Description.
171-
* @param {Description} overFrame - Description.
172-
* @param {Description} outFrame - Description.
173-
* @param {Description} downFrame - Description.
174-
* @return {Description} Description.
167+
* @param {number} [x] X position of the new button object.
168+
* @param {number} [y] Y position of the new button object.
169+
* @param {string} [key] The image key as defined in the Game.Cache to use as the texture for this button.
170+
* @param {function} [callback] The function to call when this button is pressed
171+
* @param {object} [callbackContext] The context in which the callback will be called (usually 'this')
172+
* @param {string|number} [overFrame] This is the frame or frameName that will be set when this button is in an over state. Give either a number to use a frame ID or a string for a frame name.
173+
* @param {string|number} [outFrame] This is the frame or frameName that will be set when this button is in an out state. Give either a number to use a frame ID or a string for a frame name.
174+
* @param {string|number} [downFrame] This is the frame or frameName that will be set when this button is in a down state. Give either a number to use a frame ID or a string for a frame name.
175+
* @return {Phaser.Button} The newly created button object.
175176
*/
176177
button: function (x, y, key, callback, callbackContext, overFrame, outFrame, downFrame) {
177178

@@ -183,9 +184,9 @@ Phaser.GameObjectFactory.prototype = {
183184
* Description.
184185
*
185186
* @method graphics
186-
* @param {Description} x - Description.
187-
* @param {Description} y - Description.
188-
* @return {Description} Description.
187+
* @param {number} x - X position of the new graphics object.
188+
* @param {number} y - Y position of the new graphics object.
189+
* @return {Phaser.Graphics} The newly created graphics object.
189190
*/
190191
graphics: function (x, y) {
191192

@@ -197,10 +198,10 @@ Phaser.GameObjectFactory.prototype = {
197198
* Description.
198199
*
199200
* @method emitter
200-
* @param {Description} x - Description.
201-
* @param {Description} y - Description.
202-
* @param {Description} maxParticles - Description.
203-
* @return {Description} Description.
201+
* @param {number} [x=0] - The x coordinate within the Emitter that the particles are emitted from.
202+
* @param {number} [y=0] - The y coordinate within the Emitter that the particles are emitted from.
203+
* @param {number} [maxParticles=50] - The total number of particles in this emitter.
204+
* @return {Phaser.Emitter} The newly created emitter object.
204205
*/
205206
emitter: function (x, y, maxParticles) {
206207

@@ -212,11 +213,11 @@ Phaser.GameObjectFactory.prototype = {
212213
* Description.
213214
*
214215
* @method bitmapText
215-
* @param {Description} x - Description.
216-
* @param {Description} y - Description.
217-
* @param {Description} text - Description.
218-
* @param {Description} style - Description.
219-
* @return {Description} Description.
216+
* @param {number} x - X position of the new bitmapText object.
217+
* @param {number} y - Y position of the new bitmapText object.
218+
* @param {string} text - The actual text that will be written.
219+
* @param {object} style - The style object containing style attributes like font, font size , etc.
220+
* @return {Phaser.BitmapText} The newly created bitmapText object.
220221
*/
221222
bitmapText: function (x, y, text, style) {
222223

@@ -228,8 +229,8 @@ Phaser.GameObjectFactory.prototype = {
228229
* Description.
229230
*
230231
* @method tilemap
231-
* @param {Description} key - Description.
232-
* @return {Description} Description.
232+
* @param {string} key - Asset key for the JSON file.
233+
* @return {Phaser.Tilemap} The newly created tilemap object.
233234
*/
234235
tilemap: function (key) {
235236

@@ -240,9 +241,9 @@ Phaser.GameObjectFactory.prototype = {
240241
/**
241242
* Description.
242243
*
243-
* @method tilemap
244-
* @param {Description} key - Description.
245-
* @return {Description} Description.
244+
* @method tileset
245+
* @param {string} key - The image key as defined in the Game.Cache to use as the tileset.
246+
* @return {Phaser.Tileset} The newly created tileset object.
246247
*/
247248
tileset: function (key) {
248249

@@ -253,14 +254,12 @@ Phaser.GameObjectFactory.prototype = {
253254
/**
254255
* Description.
255256
*
256-
* @method tileSprite
257-
* @param {Description} x - Description.
258-
* @param {Description} y - Description.
259-
* @param {Description} width - Description.
260-
* @param {Description} height - Description.
261-
* @param {Description} key - Description.
262-
* @param {Description} frame - Description.
263-
* @return {Description} Description.
257+
* @method tilemaplayer
258+
* @param {number} x - X position of the new tilemapLayer.
259+
* @param {number} y - Y position of the new tilemapLayer.
260+
* @param {number} width - the width of the tilemapLayer.
261+
* @param {number} height - the height of the tilemapLayer.
262+
* @return {Phaser.TilemapLayer} The newly created tilemaplayer object.
264263
*/
265264
tilemapLayer: function (x, y, width, height, tileset, tilemap, layer) {
266265

@@ -272,10 +271,10 @@ Phaser.GameObjectFactory.prototype = {
272271
* Description.
273272
*
274273
* @method renderTexture
275-
* @param {Description} key - Description.
276-
* @param {Description} width - Description.
277-
* @param {Description} height - Description.
278-
* @return {Description} Description.
274+
* @param {string} key - Asset key for the render texture.
275+
* @param {number} width - the width of the render texture.
276+
* @param {number} height - the height of the render texture.
277+
* @return {Phaser.RenderTexture} The newly created renderTexture object.
279278
*/
280279
renderTexture: function (key, width, height) {
281280

src/gameobjects/Graphics.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.Graphics
65
*/
76

87
/**
@@ -12,8 +11,8 @@
1211
* @constructor
1312
*
1413
* @param {Phaser.Game} game Current game instance.
15-
* @param {number} [x] X position of Description.
16-
* @param {number} [y] Y position of Description.
14+
* @param {number} x - X position of the new graphics object.
15+
* @param {number} y - Y position of the new graphics object.
1716
*/
1817
Phaser.Graphics = function (game, x, y) {
1918

src/gameobjects/RenderTexture.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.RenderTexture
65
*/
76

87
/**
98
* Description of constructor.
109
* @class Phaser.RenderTexture
11-
* @classdesc Description of class.
1210
* @constructor
1311
* @param {Phaser.Game} game - Current game instance.
14-
* @param {string} key - Description.
15-
* @param {number} width - Description.
16-
* @param {number} height - Description.
12+
* @param {string} key - Asset key for the render texture.
13+
* @param {number} width - the width of the render texture.
14+
* @param {number} height - the height of the render texture.
1715
*/
1816
Phaser.RenderTexture = function (game, key, width, height) {
1917

@@ -23,19 +21,19 @@ Phaser.RenderTexture = function (game, key, width, height) {
2321
this.game = game;
2422

2523
/**
26-
* @property {Description} name - Description.
24+
* @property {string} name - the name of the object.
2725
*/
2826
this.name = key;
2927

3028
PIXI.EventTarget.call( this );
3129

3230
/**
33-
* @property {number} width - Description.
31+
* @property {number} width - the width.
3432
*/
3533
this.width = width || 100;
3634

3735
/**
38-
* @property {number} height - Description.
36+
* @property {number} height - the height.
3937
*/
4038
this.height = height || 100;
4139

src/gameobjects/Text.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.Text
65
*/
76

87
/**
98
* Create a new <code>Text</code>.
109
* @class Phaser.Text
11-
* @classdesc Description of class.
1210
* @constructor
1311
* @param {Phaser.Game} game - Current game instance.
14-
* @param {Description} x - Description.
15-
* @param {Description} y - Description.
16-
* @param {string} text - Description.
17-
* @param {string} style - Description.
12+
* @param {number} x - X position of the new text object.
13+
* @param {number} y - Y position of the new text object.
14+
* @param {string} text - The actual text that will be written.
15+
* @param {object} style - The style object containing style attributes like font, font size ,
1816
*/
1917
Phaser.Text = function (game, x, y, text, style) {
2018

src/gameobjects/TileSprite.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22
* @author Richard Davey <rich@photonstorm.com>
33
* @copyright 2013 Photon Storm Ltd.
44
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
5-
* @module Phaser.TileSprite
65
*/
76

87
/**
98
* Create a new <code>TileSprite</code>.
109
* @class Phaser.Tilemap
11-
* @classdesc Class description.
1210
* @constructor
1311
* @param {Phaser.Game} game - Current game instance.
14-
* @param {object} x - Description.
15-
* @param {object} y - Description.
16-
* @param {number} width - Description.
17-
* @param {number} height - Description.
18-
* @param {string} key - Description.
19-
* @param {Description} frame - Description.
12+
* @param {number} x - X position of the new tileSprite.
13+
* @param {number} y - Y position of the new tileSprite.
14+
* @param {number} width - the width of the tilesprite.
15+
* @param {number} height - the height of the tilesprite.
16+
* @param {string|Phaser.RenderTexture|PIXI.Texture} key - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache entry, or an instance of a RenderTexture or PIXI.Texture.
17+
* @param {string|number} frame - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
2018
*/
2119
Phaser.TileSprite = function (game, x, y, width, height, key, frame) {
2220

0 commit comments

Comments
 (0)