Skip to content

Commit adb2181

Browse files
committed
Add docs for groups and Arcade.Factory
1 parent 6a8e5d2 commit adb2181

4 files changed

Lines changed: 62 additions & 56 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ var Sprite = require('../sprite/Sprite');
105105
* @constructor
106106
* @since 3.0.0
107107
* @param {Phaser.Scene} scene - The scene this group belongs to.
108-
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig)} [children] - Game objects to add to this group; or the `config` argument.
108+
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
109109
* @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group. If `key` is set, Phaser.GameObjects.Group#createMultiple is also called with these settings.
110110
*
111111
* @see Phaser.Physics.Arcade.Group

src/physics/arcade/Factory.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ var Factory = new Class({
101101
* @method Phaser.Physics.Arcade.Factory#existing
102102
* @since 3.0.0
103103
*
104-
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
105-
* @param {boolean} [isStatic=false] - Set to true to create a Static body, otherwise it will create a Dynamic body.
104+
* @param {Phaser.GameObjects.GameObject} gameObject - A Game Object.
105+
* @param {boolean} [isStatic=false] - Create a Static body (true) or Dynamic body (false).
106106
*
107107
* @return {Phaser.GameObjects.GameObject} The Game Object.
108108
*/
@@ -220,8 +220,8 @@ var Factory = new Class({
220220
* @method Phaser.Physics.Arcade.Factory#staticGroup
221221
* @since 3.0.0
222222
*
223-
* @param {object|object[]} [children] - [description]
224-
* @param {GroupConfig} [config] - [description]
223+
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
224+
* @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group.
225225
*
226226
* @return {Phaser.Physics.Arcade.StaticGroup} The Static Group object that was created.
227227
*/
@@ -237,8 +237,8 @@ var Factory = new Class({
237237
* @method Phaser.Physics.Arcade.Factory#group
238238
* @since 3.0.0
239239
*
240-
* @param {object|object[]} [children] - [description]
241-
* @param {PhysicsGroupConfig} [config] - [description]
240+
* @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
241+
* @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group.
242242
*
243243
* @return {Phaser.Physics.Arcade.Group} The Group object that was created.
244244
*/

src/physics/arcade/PhysicsGroup.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,27 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
4141
/**
4242
* @typedef {object} PhysicsGroupDefaults
4343
*
44-
* @property {boolean} setCollideWorldBounds - [description]
45-
* @property {number} setAccelerationX - [description]
46-
* @property {number} setAccelerationY - [description]
47-
* @property {boolean} setAllowDrag - [description]
48-
* @property {boolean} setAllowGravity - [description]
49-
* @property {boolean} setAllowRotation - [description]
50-
* @property {number} setBounceX - [description]
51-
* @property {number} setBounceY - [description]
52-
* @property {number} setDragX - [description]
53-
* @property {number} setDragY - [description]
54-
* @property {number} setGravityX - [description]
55-
* @property {number} setGravityY - [description]
56-
* @property {number} setFrictionX - [description]
57-
* @property {number} setFrictionY - [description]
58-
* @property {number} setVelocityX - [description]
59-
* @property {number} setVelocityY - [description]
60-
* @property {number} setAngularVelocity - [description]
61-
* @property {number} setAngularAcceleration - [description]
62-
* @property {number} setAngularDrag - [description]
63-
* @property {number} setMass - [description]
64-
* @property {boolean} setImmovable - [description]
44+
* @property {boolean} setCollideWorldBounds - As {@link Phaser.Physics.Arcade.Body#setCollideWorldBounds}.
45+
* @property {number} setAccelerationX - As {@link Phaser.Physics.Arcade.Body#setAccelerationX}.
46+
* @property {number} setAccelerationY - As {@link Phaser.Physics.Arcade.Body#setAccelerationY}.
47+
* @property {boolean} setAllowDrag - As {@link Phaser.Physics.Arcade.Body#setAllowDrag}.
48+
* @property {boolean} setAllowGravity - As {@link Phaser.Physics.Arcade.Body#setAllowGravity}.
49+
* @property {boolean} setAllowRotation - As {@link Phaser.Physics.Arcade.Body#setAllowRotation}.
50+
* @property {number} setBounceX - As {@link Phaser.Physics.Arcade.Body#setBounceX}.
51+
* @property {number} setBounceY - As {@link Phaser.Physics.Arcade.Body#setBounceY}.
52+
* @property {number} setDragX - As {@link Phaser.Physics.Arcade.Body#setDragX}.
53+
* @property {number} setDragY - As {@link Phaser.Physics.Arcade.Body#setDragY}.
54+
* @property {number} setGravityX - As {@link Phaser.Physics.Arcade.Body#setGravityX}.
55+
* @property {number} setGravityY - As {@link Phaser.Physics.Arcade.Body#setGravityY}.
56+
* @property {number} setFrictionX - As {@link Phaser.Physics.Arcade.Body#setFrictionX}.
57+
* @property {number} setFrictionY - As {@link Phaser.Physics.Arcade.Body#setFrictionY}.
58+
* @property {number} setVelocityX - As {@link Phaser.Physics.Arcade.Body#setVelocityX}.
59+
* @property {number} setVelocityY - As {@link Phaser.Physics.Arcade.Body#setVelocityY}.
60+
* @property {number} setAngularVelocity - As {@link Phaser.Physics.Arcade.Body#setAngularVelocity}.
61+
* @property {number} setAngularAcceleration - As {@link Phaser.Physics.Arcade.Body#setAngularAcceleration}.
62+
* @property {number} setAngularDrag - As {@link Phaser.Physics.Arcade.Body#setAngularDrag}.
63+
* @property {number} setMass - As {@link Phaser.Physics.Arcade.Body#setMass}.
64+
* @property {boolean} setImmovable - As {@link Phaser.Physics.Arcade.Body#setImmovable}.
6565
*/
6666

6767
/**
@@ -78,10 +78,10 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
7878
* @constructor
7979
* @since 3.0.0
8080
*
81-
* @param {Phaser.Physics.Arcade.World} world - [description]
82-
* @param {Phaser.Scene} scene - [description]
83-
* @param {array} children - [description]
84-
* @param {PhysicsGroupConfig} [config] - [description]
81+
* @param {Phaser.Physics.Arcade.World} world - The physics simulation.
82+
* @param {Phaser.Scene} scene - The scene this group belongs to.
83+
* @param {(Phaser.GameObjects.GameObject[]|PhysicsGroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
84+
* @param {PhysicsGroupConfig|GroupCreateConfig} [config] - Settings for this group.
8585
*/
8686
var PhysicsGroup = new Class({
8787

@@ -121,7 +121,7 @@ var PhysicsGroup = new Class({
121121
}
122122

123123
/**
124-
* [description]
124+
* The physics simulation.
125125
*
126126
* @name Phaser.Physics.Arcade.Group#world
127127
* @type {Phaser.Physics.Arcade.World}
@@ -140,7 +140,7 @@ var PhysicsGroup = new Class({
140140
config.classType = GetFastValue(config, 'classType', ArcadeSprite);
141141

142142
/**
143-
* [description]
143+
* The physics type of the Group's members.
144144
*
145145
* @name Phaser.Physics.Arcade.Group#physicsType
146146
* @type {integer}
@@ -189,7 +189,7 @@ var PhysicsGroup = new Class({
189189
* @method Phaser.Physics.Arcade.Group#createCallbackHandler
190190
* @since 3.0.0
191191
*
192-
* @param {Phaser.GameObjects.GameObject} child - [description]
192+
* @param {Phaser.GameObjects.GameObject} child - The Game Object being added.
193193
*/
194194
createCallbackHandler: function (child)
195195
{
@@ -212,7 +212,7 @@ var PhysicsGroup = new Class({
212212
* @method Phaser.Physics.Arcade.Group#removeCallbackHandler
213213
* @since 3.0.0
214214
*
215-
* @param {Phaser.GameObjects.GameObject} child - [description]
215+
* @param {Phaser.GameObjects.GameObject} child - The Game Object being removed.
216216
*/
217217
removeCallbackHandler: function (child)
218218
{
@@ -228,9 +228,9 @@ var PhysicsGroup = new Class({
228228
* @method Phaser.Physics.Arcade.Group#setVelocity
229229
* @since 3.0.0
230230
*
231-
* @param {number} x - [description]
232-
* @param {number} y - [description]
233-
* @param {number} step - [description]
231+
* @param {number} x - The horizontal velocity.
232+
* @param {number} y - The vertical velocity.
233+
* @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x, y), the second (x + step, y + step), and so on.
234234
*
235235
* @return {Phaser.Physics.Arcade.Group} This Physics Group object.
236236
*/
@@ -254,8 +254,8 @@ var PhysicsGroup = new Class({
254254
* @method Phaser.Physics.Arcade.Group#setVelocityX
255255
* @since 3.0.0
256256
*
257-
* @param {number} value - [description]
258-
* @param {number} step - [description]
257+
* @param {number} value - The velocity value.
258+
* @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (x), the second (x + step), and so on.
259259
*
260260
* @return {Phaser.Physics.Arcade.Group} This Physics Group object.
261261
*/
@@ -279,8 +279,8 @@ var PhysicsGroup = new Class({
279279
* @method Phaser.Physics.Arcade.Group#setVelocityY
280280
* @since 3.0.0
281281
*
282-
* @param {number} value - [description]
283-
* @param {number} step - [description]
282+
* @param {number} value - The velocity value.
283+
* @param {number} [step=0] - The velocity increment. When set, the first member receives velocity (y), the second (y + step), and so on.
284284
*
285285
* @return {Phaser.Physics.Arcade.Group} This Physics Group object.
286286
*/

src/physics/arcade/StaticPhysicsGroup.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ var IsPlainObject = require('../../utils/object/IsPlainObject');
2424
* @constructor
2525
* @since 3.0.0
2626
*
27-
* @param {Phaser.Physics.Arcade.World} world - [description]
28-
* @param {Phaser.Scene} scene - [description]
29-
* @param {array} children - [description]
30-
* @param {GroupConfig} config - [description]
27+
* @param {Phaser.Physics.Arcade.World} world - The physics simulation.
28+
* @param {Phaser.Scene} scene - The scene this group belongs to.
29+
* @param {(Phaser.GameObjects.GameObject[]|GroupConfig|GroupCreateConfig)} [children] - Game Objects to add to this group; or the `config` argument.
30+
* @param {GroupConfig|GroupCreateConfig} [config] - Settings for this group.
3131
*/
3232
var StaticPhysicsGroup = new Class({
3333

@@ -73,7 +73,7 @@ var StaticPhysicsGroup = new Class({
7373
}
7474

7575
/**
76-
* [description]
76+
* The physics simulation.
7777
*
7878
* @name Phaser.Physics.Arcade.StaticGroup#world
7979
* @type {Phaser.Physics.Arcade.World}
@@ -82,7 +82,7 @@ var StaticPhysicsGroup = new Class({
8282
this.world = world;
8383

8484
/**
85-
* [description]
85+
* The scene this group belongs to.
8686
*
8787
* @name Phaser.Physics.Arcade.StaticGroup#physicsType
8888
* @type {integer}
@@ -95,12 +95,14 @@ var StaticPhysicsGroup = new Class({
9595
},
9696

9797
/**
98-
* [description]
98+
* Adds a static physics body to the new group member (if it lacks one) and adds it to the simulation.
9999
*
100100
* @method Phaser.Physics.Arcade.StaticGroup#createCallbackHandler
101101
* @since 3.0.0
102102
*
103-
* @param {Phaser.GameObjects.GameObject} child - [description]
103+
* @param {Phaser.GameObjects.GameObject} child - The new group member.
104+
*
105+
* @see Phaser.Physics.Arcade.World#enableBody
104106
*/
105107
createCallbackHandler: function (child)
106108
{
@@ -111,12 +113,14 @@ var StaticPhysicsGroup = new Class({
111113
},
112114

113115
/**
114-
* [description]
116+
* Disables the group member's physics body, removing it from the simulation.
115117
*
116118
* @method Phaser.Physics.Arcade.StaticGroup#removeCallbackHandler
117119
* @since 3.0.0
118120
*
119-
* @param {Phaser.GameObjects.GameObject} child - [description]
121+
* @param {Phaser.GameObjects.GameObject} child - The group member being removed.
122+
*
123+
* @see Phaser.Physics.Arcade.World#disableBody
120124
*/
121125
removeCallbackHandler: function (child)
122126
{
@@ -127,12 +131,14 @@ var StaticPhysicsGroup = new Class({
127131
},
128132

129133
/**
130-
* [description]
134+
* Refreshes the group.
131135
*
132136
* @method Phaser.Physics.Arcade.StaticGroup#createMultipleCallbackHandler
133137
* @since 3.0.0
134138
*
135-
* @param {object} entries - [description]
139+
* @param {Phaser.GameObjects.GameObject[]} entries - The newly created group members.
140+
*
141+
* @see Phaser.Physics.Arcade.StaticGroup#refresh
136142
*/
137143
createMultipleCallbackHandler: function ()
138144
{
@@ -146,7 +152,7 @@ var StaticPhysicsGroup = new Class({
146152
* @method Phaser.Physics.Arcade.StaticGroup#refresh
147153
* @since 3.0.0
148154
*
149-
* @return {Phaser.Physics.Arcade.StaticGroup} [description]
155+
* @return {Phaser.Physics.Arcade.StaticGroup} This group.
150156
*
151157
* @see Phaser.Physics.Arcade.StaticBody#reset
152158
*/

0 commit comments

Comments
 (0)