Skip to content

Commit c1771ec

Browse files
committed
Merge branch 'master' of https://github.com/photonstorm/phaser
2 parents 8cd45a7 + 96b9db5 commit c1771ec

11 files changed

Lines changed: 51 additions & 38 deletions

File tree

src/cameras/2d/BaseCamera.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,7 @@ var BaseCamera = new Class({
17011701
},
17021702

17031703
/**
1704-
* The x position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1704+
* The horizontal position of the center of the Camera's viewport, relative to the left of the game canvas.
17051705
*
17061706
* @name Phaser.Cameras.Scene2D.BaseCamera#centerX
17071707
* @type {number}
@@ -1718,7 +1718,7 @@ var BaseCamera = new Class({
17181718
},
17191719

17201720
/**
1721-
* The y position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1721+
* The vertical position of the center of the Camera's viewport, relative to the top of the game canvas.
17221722
*
17231723
* @name Phaser.Cameras.Scene2D.BaseCamera#centerY
17241724
* @type {number}

src/gameobjects/group/Group.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Sprite = require('../sprite/Sprite');
2828
/**
2929
* @typedef {object} GroupConfig
3030
*
31-
* @property {?object} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
31+
* @property {?GroupClassTypeConstructor} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
3232
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
3333
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
3434
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.
@@ -52,7 +52,7 @@ var Sprite = require('../sprite/Sprite');
5252
*
5353
* `key` is required. {@link Phaser.GameObjects.Group#defaultKey} is not used.
5454
*
55-
* @property {?object} [classType] - The class of each new Game Object.
55+
* @property {?GroupClassTypeConstructor} [classType] - The class of each new Game Object.
5656
* @property {string} [key] - The texture key of each new Game Object.
5757
* @property {?(string|integer)} [frame=null] - The texture frame of each new Game Object.
5858
* @property {?boolean} [visible=true] - The visible state of each new Game Object.
@@ -93,6 +93,18 @@ var Sprite = require('../sprite/Sprite');
9393
* @see Phaser.Utils.Array.Range
9494
*/
9595

96+
/**
97+
* A constructor function (class) that can be assigned to `classType`.
98+
* @callback GroupClassTypeConstructor
99+
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
100+
* @param {number} x - The horizontal position of this Game Object in the world.
101+
* @param {number} y - The vertical position of this Game Object in the world.
102+
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
103+
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
104+
*
105+
* @see Phaser.GameObjects.Group#classType
106+
*/
107+
96108
/**
97109
* @classdesc A Group is a way for you to create, manipulate, or recycle similar Game Objects.
98110
*
@@ -185,7 +197,7 @@ var Group = new Class({
185197
* The class to create new group members from.
186198
*
187199
* @name Phaser.GameObjects.Group#classType
188-
* @type {object}
200+
* @type {GroupClassTypeConstructor}
189201
* @since 3.0.0
190202
* @default Phaser.GameObjects.Sprite
191203
*/

src/physics/arcade/ArcadeImage.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ var Image = require('../../gameobjects/image/Image');
1010

1111
/**
1212
* @classdesc
13-
* An Arcade Physics Image Game Object.
13+
* An Arcade Physics Image is an Image with an Arcade Physics body and related components.
14+
* The body can be dynamic or static.
1415
*
15-
* An Image is a light-weight Game Object useful for the display of static images in your game,
16-
* such as logos, backgrounds, scenery or other non-animated elements. Images can have input
17-
* events and physics bodies, or be tweened, tinted or scrolled. The main difference between an
18-
* Image and a Sprite is that you cannot animate an Image as they do not have the Animation component.
16+
* The main difference between an Arcade Image and an Arcade Sprite is that you cannot animate an Arcade Image.
1917
*
2018
* @class Image
2119
* @extends Phaser.GameObjects.Image

src/physics/arcade/ArcadeSprite.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ var Sprite = require('../../gameobjects/sprite/Sprite');
1010

1111
/**
1212
* @classdesc
13-
* An Arcade Physics Sprite Game Object.
13+
* An Arcade Physics Sprite is a Sprite with an Arcade Physics body and related components.
14+
* The body can be dynamic or static.
1415
*
15-
* A Sprite Game Object is used for the display of both static and animated images in your game.
16-
* Sprites can have input events and physics bodies. They can also be tweened, tinted, scrolled
17-
* and animated.
18-
*
19-
* The main difference between a Sprite and an Image Game Object is that you cannot animate Images.
20-
* As such, Sprites take a fraction longer to process and have a larger API footprint due to the Animation
21-
* Component. If you do not require animation then you can safely use Images to replace Sprites in all cases.
16+
* The main difference between an Arcade Sprite and an Arcade Image is that you cannot animate an Arcade Image.
17+
* If you do not require animation then you can safely use Arcade Images instead of Arcade Sprites.
2218
*
2319
* @class Sprite
2420
* @extends Phaser.GameObjects.Sprite

src/physics/arcade/Body.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ var Body = new Class({
623623
this.overlapR = 0;
624624

625625
/**
626-
* Whether this Body is overlapped with another and both have zero velocity.
626+
* Whether this Body is overlapped with another and both are not moving.
627627
*
628628
* @name Phaser.Physics.Arcade.Body#embedded
629629
* @type {boolean}
@@ -718,6 +718,7 @@ var Body = new Class({
718718
* @name Phaser.Physics.Arcade.Body#physicsType
719719
* @type {integer}
720720
* @readonly
721+
* @default Phaser.Physics.Arcade.DYNAMIC_BODY
721722
* @since 3.0.0
722723
*/
723724
this.physicsType = CONST.DYNAMIC_BODY;
@@ -787,7 +788,8 @@ var Body = new Class({
787788
},
788789

789790
/**
790-
* Updates this Body's transform, dimensions, and position from its Game Object.
791+
* Updates the Body's `transform`, `width`, `height`, and `center` from its Game Object.
792+
* The Body's `position` isn't changed.
791793
*
792794
* @method Phaser.Physics.Arcade.Body#updateBounds
793795
* @since 3.0.0
@@ -874,7 +876,7 @@ var Body = new Class({
874876
* @fires Phaser.Physics.Arcade.World#worldbounds
875877
* @since 3.0.0
876878
*
877-
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
879+
* @param {number} delta - The delta time, in seconds, elapsed since the last frame.
878880
*/
879881
update: function (delta)
880882
{

src/physics/arcade/Collider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var Collider = new Class({
4040
this.world = world;
4141

4242
/**
43-
* The name of the collider (unused by phaser).
43+
* The name of the collider (unused by Phaser).
4444
*
4545
* @name Phaser.Physics.Arcade.Collider#name
4646
* @type {string}

src/physics/arcade/Factory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var Factory = new Class({
5858
},
5959

6060
/**
61-
* Create a new Arcade Physics Collider object.
61+
* Creates a new Arcade Physics Collider object.
6262
*
6363
* @method Phaser.Physics.Arcade.Factory#collider
6464
* @since 3.0.0
@@ -77,7 +77,7 @@ var Factory = new Class({
7777
},
7878

7979
/**
80-
* Create a new Arcade Physics Collider Overlap object.
80+
* Creates a new Arcade Physics Collider Overlap object.
8181
*
8282
* @method Phaser.Physics.Arcade.Factory#overlap
8383
* @since 3.0.0

src/physics/arcade/PhysicsGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ var PhysicsGroup = new Class({
154154
*
155155
* @name Phaser.Physics.Arcade.Group#physicsType
156156
* @type {integer}
157-
* @default DYNAMIC_BODY
157+
* @default Phaser.Physics.Arcade.DYNAMIC_BODY
158158
* @since 3.0.0
159159
*/
160160
this.physicsType = CONST.DYNAMIC_BODY;

src/physics/arcade/StaticBody.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,12 @@ var StaticBody = new Class({
219219
// If true this Body will dispatch events
220220

221221
/**
222-
* Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary (and `collideWorldBounds` is also true).
222+
* Whether the simulation emits a `worldbounds` event when this StaticBody collides with the world boundary.
223+
* Always false for a Static Body. (Static Bodies never collide with the world boundary and never trigger a `worldbounds` event.)
223224
*
224225
* @name Phaser.Physics.Arcade.StaticBody#onWorldBounds
225226
* @type {boolean}
227+
* @readonly
226228
* @default false
227229
* @since 3.0.0
228230
*/
@@ -269,7 +271,7 @@ var StaticBody = new Class({
269271
this.immovable = true;
270272

271273
/**
272-
* A flag disabling the default horizontal separation of colliding bodies. Pass your own `processHandler` to the collider.
274+
* A flag disabling the default horizontal separation of colliding bodies. Pass your own `collideHandler` to the collider.
273275
*
274276
* @name Phaser.Physics.Arcade.StaticBody#customSeparateX
275277
* @type {boolean}
@@ -279,7 +281,7 @@ var StaticBody = new Class({
279281
this.customSeparateX = false;
280282

281283
/**
282-
* A flag disabling the default vertical separation of colliding bodies. Pass your own `processHandler` to the collider.
284+
* A flag disabling the default vertical separation of colliding bodies. Pass your own `collideHandler` to the collider.
283285
*
284286
* @name Phaser.Physics.Arcade.StaticBody#customSeparateY
285287
* @type {boolean}
@@ -319,7 +321,7 @@ var StaticBody = new Class({
319321
this.overlapR = 0;
320322

321323
/**
322-
* Whether this StaticBody is overlapped with another and both have zero velocity.
324+
* Whether this StaticBody has ever overlapped with another while both were not moving.
323325
*
324326
* @name Phaser.Physics.Arcade.StaticBody#embedded
325327
* @type {boolean}
@@ -330,9 +332,11 @@ var StaticBody = new Class({
330332

331333
/**
332334
* Whether this StaticBody interacts with the world boundary.
335+
* Always false for a Static Body. (Static Bodies never collide with the world boundary.)
333336
*
334337
* @name Phaser.Physics.Arcade.StaticBody#collideWorldBounds
335338
* @type {boolean}
339+
* @readonly
336340
* @default false
337341
* @since 3.0.0
338342
*/
@@ -348,7 +352,7 @@ var StaticBody = new Class({
348352
this.checkCollision = { none: false, up: true, down: true, left: true, right: true };
349353

350354
/**
351-
* Whether this StaticBody is colliding with another and in which direction.
355+
* Whether this StaticBody has ever collided with another body and in which direction.
352356
*
353357
* @name Phaser.Physics.Arcade.StaticBody#touching
354358
* @type {ArcadeBodyCollision}
@@ -357,7 +361,7 @@ var StaticBody = new Class({
357361
this.touching = { none: true, up: false, down: false, left: false, right: false };
358362

359363
/**
360-
* Whether this StaticBody was colliding with another during the last step, and in which direction.
364+
* Whether this StaticBody was colliding with another body during the last step or any previous step, and in which direction.
361365
*
362366
* @name Phaser.Physics.Arcade.StaticBody#wasTouching
363367
* @type {ArcadeBodyCollision}
@@ -366,7 +370,7 @@ var StaticBody = new Class({
366370
this.wasTouching = { none: true, up: false, down: false, left: false, right: false };
367371

368372
/**
369-
* Whether this StaticBody is colliding with a tile or the world boundary.
373+
* Whether this StaticBody has ever collided with a tile or the world boundary.
370374
*
371375
* @name Phaser.Physics.Arcade.StaticBody#blocked
372376
* @type {ArcadeBodyCollision}
@@ -379,6 +383,7 @@ var StaticBody = new Class({
379383
*
380384
* @name Phaser.Physics.Arcade.StaticBody#physicsType
381385
* @type {integer}
386+
* @default Phaser.Physics.Arcade.STATIC_BODY
382387
* @since 3.0.0
383388
*/
384389
this.physicsType = CONST.STATIC_BODY;

src/physics/arcade/StaticPhysicsGroup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var StaticPhysicsGroup = new Class({
8686
*
8787
* @name Phaser.Physics.Arcade.StaticGroup#physicsType
8888
* @type {integer}
89-
* @default STATIC_BODY
89+
* @default Phaser.Physics.Arcade.STATIC_BODY
9090
* @since 3.0.0
9191
*/
9292
this.physicsType = CONST.STATIC_BODY;

0 commit comments

Comments
 (0)