Skip to content

Commit 3c79a92

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 7d573a3 + d6a13eb commit 3c79a92

10 files changed

Lines changed: 52 additions & 37 deletions

File tree

src/gameobjects/particles/ParticleEmitterManager.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ var Render = require('./ParticleManagerRender');
2828
*
2929
* @param {Phaser.Scene} scene - The Scene to which this Emitter Manager belongs.
3030
* @param {string} texture - The key of the Texture this Emitter Manager will use to render particles, as stored in the Texture Manager.
31-
* @param {(string|integer)} frame - An optional frame from the Texture this Emitter Manager will use to render particles.
32-
* @param {ParticleEmitterConfig|ParticleEmitterConfig[]} emitters - Configuration settings for one or more emitters to create.
31+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Emitter Manager will use to render particles.
32+
* @param {ParticleEmitterConfig|ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create.
3333
*/
3434
var ParticleEmitterManager = new Class({
3535

@@ -50,7 +50,7 @@ var ParticleEmitterManager = new Class({
5050
GameObject.call(this, scene, 'ParticleEmitterManager');
5151

5252
/**
53-
* [description]
53+
* The blend mode applied to all emitters and particles.
5454
*
5555
* @name Phaser.GameObjects.Particles.ParticleEmitterManager#blendMode
5656
* @type {integer}
@@ -66,7 +66,7 @@ var ParticleEmitterManager = new Class({
6666
* This is multiplied with any timeScale set on each individual emitter.
6767
*
6868
* @name Phaser.GameObjects.Particles.ParticleEmitterManager#timeScale
69-
* @type {float}
69+
* @type {number}
7070
* @default 1
7171
* @since 3.0.0
7272
*/
@@ -255,7 +255,7 @@ var ParticleEmitterManager = new Class({
255255
* @method Phaser.GameObjects.Particles.ParticleEmitterManager#createEmitter
256256
* @since 3.0.0
257257
*
258-
* @param {object} config - [description]
258+
* @param {ParticleEmitterConfig} config - Configuration settings for the Particle Emitter to create.
259259
*
260260
* @return {Phaser.GameObjects.Particles.ParticleEmitter} The Particle Emitter that was created.
261261
*/
@@ -285,7 +285,7 @@ var ParticleEmitterManager = new Class({
285285
* @method Phaser.GameObjects.Particles.ParticleEmitterManager#createGravityWell
286286
* @since 3.0.0
287287
*
288-
* @param {object} config - [description]
288+
* @param {GravityWellConfig} config - Configuration settings for the Gravity Well to create.
289289
*
290290
* @return {Phaser.GameObjects.Particles.GravityWell} The Gravity Well that was created.
291291
*/
@@ -301,8 +301,8 @@ var ParticleEmitterManager = new Class({
301301
* @since 3.0.0
302302
*
303303
* @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}.
304-
* @param {float} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.
305-
* @param {float} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.
304+
* @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.
305+
* @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.
306306
*
307307
* @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.
308308
*/
@@ -329,8 +329,8 @@ var ParticleEmitterManager = new Class({
329329
* @method Phaser.GameObjects.Particles.ParticleEmitterManager#emitParticleAt
330330
* @since 3.0.0
331331
*
332-
* @param {float} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.
333-
* @param {float} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.
332+
* @param {number} [x] - The x-coordinate to to emit particles from. The default is the x-coordinate of the emitter's current location.
333+
* @param {number} [y] - The y-coordinate to to emit particles from. The default is the y-coordinate of the emitter's current location.
334334
* @param {integer} [count] - The number of particles to release from each emitter. The default is the emitter's own {@link Phaser.GameObjects.Particles.ParticleEmitter#quantity}.
335335
*
336336
* @return {Phaser.GameObjects.Particles.ParticleEmitterManager} This Emitter Manager.
@@ -394,7 +394,7 @@ var ParticleEmitterManager = new Class({
394394
* @since 3.0.0
395395
*
396396
* @param {integer} time - The current timestamp as generated by the Request Animation Frame or SetTimeout.
397-
* @param {float} delta - The delta time, in ms, elapsed since the last frame.
397+
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
398398
*/
399399
preUpdate: function (time, delta)
400400
{

src/gameobjects/particles/ParticleManagerFactory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ var ParticleEmitterManager = require('./ParticleEmitterManager');
1616
* @since 3.0.0
1717
*
1818
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
19-
* @param {(string|integer|object)} [frame] - [description]
20-
* @param {object} [emitters] - [description]
19+
* @param {(string|integer|object)} [frame] - An optional frame from the Texture this Game Object is rendering with.
20+
* @param {ParticleEmitterConfig|ParticleEmitterConfig[]} [emitters] - Configuration settings for one or more emitters to create.
2121
*
2222
* @return {Phaser.GameObjects.Particles.ParticleEmitterManager} The Game Object that was created.
2323
*/

src/gameobjects/particles/zones/DeathZone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ var Class = require('../../../utils/Class');
99
/**
1010
* @callback DeathZoneSourceCallback
1111
*
12-
* @param {float} x - [description]
13-
* @param {float} y - [description]
12+
* @param {number} x - The x coordinate of the particle to check against this source area.
13+
* @param {number} y - The y coordinate of the particle to check against this source area.
1414
*
1515
* @return {boolean} - True if the coordinates are within the source area.
1616
*/

src/gameobjects/pathfollower/PathFollower.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var Vector2 = require('../../math/Vector2');
4343
* @constructor
4444
* @since 3.0.0
4545
*
46-
* @param {Phaser.Scene} scene - [description]
46+
* @param {Phaser.Scene} scene - The Scene to which this PathFollower belongs.
4747
* @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.
4848
* @param {number} x - The horizontal position of this Game Object in the world.
4949
* @param {number} y - The vertical position of this Game Object in the world.

src/gameobjects/sprite3d/Sprite3D.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var Sprite3D = new Class({
4141
GameObject.call(this, scene, 'Sprite3D');
4242

4343
/**
44-
* [description]
44+
* The encapsulated Sprite.
4545
*
4646
* @name Phaser.GameObjects.Sprite3D#gameObject
4747
* @type {Phaser.GameObjects.GameObject}
@@ -50,7 +50,7 @@ var Sprite3D = new Class({
5050
this.gameObject = new Sprite(scene, 0, 0, texture, frame);
5151

5252
/**
53-
* [description]
53+
* The position of the Sprite.
5454
*
5555
* @name Phaser.GameObjects.Sprite3D#position
5656
* @type {Phaser.Math.Vector4}
@@ -59,7 +59,7 @@ var Sprite3D = new Class({
5959
this.position = new Vector4(x, y, z);
6060

6161
/**
62-
* [description]
62+
* The 2D size of the Sprite.
6363
*
6464
* @name Phaser.GameObjects.Sprite3D#size
6565
* @type {Phaser.Math.Vector2}
@@ -68,7 +68,7 @@ var Sprite3D = new Class({
6868
this.size = new Vector2(this.gameObject.width, this.gameObject.height);
6969

7070
/**
71-
* [description]
71+
* The 2D scale of the Sprite.
7272
*
7373
* @name Phaser.GameObjects.Sprite3D#scale
7474
* @type {Phaser.Math.Vector2}
@@ -77,7 +77,7 @@ var Sprite3D = new Class({
7777
this.scale = new Vector2(1, 1);
7878

7979
/**
80-
* [description]
80+
* Whether to automatically set the horizontal scale of the encapsulated Sprite.
8181
*
8282
* @name Phaser.GameObjects.Sprite3D#adjustScaleX
8383
* @type {boolean}
@@ -87,7 +87,7 @@ var Sprite3D = new Class({
8787
this.adjustScaleX = true;
8888

8989
/**
90-
* [description]
90+
* Whether to automatically set the vertical scale of the encapsulated Sprite.
9191
*
9292
* @name Phaser.GameObjects.Sprite3D#adjustScaleY
9393
* @type {boolean}
@@ -97,7 +97,7 @@ var Sprite3D = new Class({
9797
this.adjustScaleY = true;
9898

9999
/**
100-
* [description]
100+
* The visible state of the Game Object.
101101
*
102102
* @name Phaser.GameObjects.Sprite3D#_visible
103103
* @type {boolean}
@@ -109,7 +109,7 @@ var Sprite3D = new Class({
109109
},
110110

111111
/**
112-
* [description]
112+
* Project this Sprite onto the given 3D Camera.
113113
*
114114
* @method Phaser.GameObjects.Sprite3D#project
115115
* @since 3.0.0
@@ -152,12 +152,12 @@ var Sprite3D = new Class({
152152
},
153153

154154
/**
155-
* [description]
155+
* Set the visible state of the Game Object.
156156
*
157157
* @method Phaser.GameObjects.Sprite3D#setVisible
158158
* @since 3.0.0
159159
*
160-
* @param {boolean} value - [description]
160+
* @param {boolean} value - The visible state of the Game Object.
161161
*
162162
* @return {Phaser.GameObjects.Sprite3D} This Sprite3D Object.
163163
*/

src/gameobjects/text/GetTextSize.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
* @function Phaser.GameObjects.Text.GetTextSize
1111
* @since 3.0.0
1212
*
13-
* @param {Phaser.GameObjects.Text} text - The Text object to get the size from.
14-
* @param {number} size - [description]
15-
* @param {array} lines - [description]
13+
* @param {Phaser.GameObjects.Text} text - The Text object to calculate the size from.
14+
* @param {TextMetrics} size - The Text metrics to use when calculating the size.
15+
* @param {array} lines - The lines of text to calculate the size from.
1616
*
1717
* @return {object} An object containing dimensions of the Text object.
1818
*/
@@ -25,7 +25,7 @@ var GetTextSize = function (text, size, lines)
2525
var lineWidths = [];
2626
var maxLineWidth = 0;
2727
var drawnLines = lines.length;
28-
28+
2929
if (style.maxLines > 0 && style.maxLines < lines.length)
3030
{
3131
drawnLines = style.maxLines;

src/gameobjects/text/TextStyle.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,16 @@ var propertyMap = {
5050
wordWrapUseAdvanced: [ 'wordWrap.useAdvancedWrap', false ]
5151
};
5252

53+
/**
54+
* Font metrics for a Text Style object.
55+
*
56+
* @typedef {object} TextMetrics
57+
*
58+
* @property {number} ascent - The ascent of the font.
59+
* @property {number} descent - The descent of the font.
60+
* @property {number} fontSize - The size of the font.
61+
*/
62+
5363
/**
5464
* @classdesc
5565
* Style settings for a Text object.
@@ -60,7 +70,7 @@ var propertyMap = {
6070
* @since 3.0.0
6171
*
6272
* @param {Phaser.GameObjects.Text} text - The Text object that this TextStyle is styling.
63-
* @param {CSSStyleRule} style - The style settings to set.
73+
* @param {object} style - The style settings to set.
6474
*/
6575
var TextStyle = new Class({
6676

@@ -919,7 +929,7 @@ var TextStyle = new Class({
919929
* @method Phaser.GameObjects.Text.TextStyle#getTextMetrics
920930
* @since 3.0.0
921931
*
922-
* @return {object} The text metrics.
932+
* @return {TextMetrics} The text metrics.
923933
*/
924934
getTextMetrics: function ()
925935
{

src/gameobjects/tilesprite/TileSprite.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ var TileSpriteRender = require('./TileSpriteRender');
1414

1515
/**
1616
* @classdesc
17+
* A TileSprite is a Sprite that has a repeating texture.
18+
*
19+
* The texture can be scrolled and scaled independently of the TileSprite itself. Textures will automatically wrap and
20+
* are designed so that you can create game backdrops using seamless textures as a source.
21+
*
1722
* [description]
1823
*
1924
* @class TileSprite
@@ -153,7 +158,7 @@ var TileSprite = new Class({
153158
this.potHeight = GetPowerOfTwo(this.frame.height);
154159

155160
/**
156-
* [description]
161+
* The Canvas Pattern used to repeat the TileSprite's texture.
157162
*
158163
* @name Phaser.GameObjects.TileSprite#canvasPattern
159164
* @type {?CanvasPattern}
@@ -163,7 +168,7 @@ var TileSprite = new Class({
163168
this.canvasPattern = null;
164169

165170
/**
166-
* [description]
171+
* The Canvas that the TileSprite's texture is rendered to.
167172
*
168173
* @name Phaser.GameObjects.TileSprite#canvasBuffer
169174
* @type {HTMLCanvasElement}
@@ -172,7 +177,7 @@ var TileSprite = new Class({
172177
this.canvasBuffer = CanvasPool.create2D(this, this.potWidth, this.potHeight);
173178

174179
/**
175-
* [description]
180+
* The Canvas Context used to render the TileSprite's texture.
176181
*
177182
* @name Phaser.GameObjects.TileSprite#canvasBufferCtx
178183
* @type {CanvasRenderingContext2D}

src/gameobjects/zone/Zone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var RectangleContains = require('../../geom/rectangle/Contains');
4141
* @extends Phaser.GameObjects.Components.ScrollFactor
4242
* @extends Phaser.GameObjects.Components.Visible
4343
*
44-
* @param {Phaser.Scene} scene - [description]
44+
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs.
4545
* @param {number} x - The horizontal position of this Game Object in the world.
4646
* @param {number} y - The vertical position of this Game Object in the world.
4747
* @param {number} [width=1] - The width of the Game Object.

src/gameobjects/zone/ZoneCreator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var Zone = require('./Zone');
1616
* @method Phaser.GameObjects.GameObjectCreator#zone
1717
* @since 3.0.0
1818
*
19-
* @param {object} config - [description]
19+
* @param {object} config - The configuration object this Game Object will use to create itself.
2020
*
2121
* @return {Phaser.GameObjects.Zone} The Game Object that was created.
2222
*/

0 commit comments

Comments
 (0)