Skip to content

Commit 8585541

Browse files
committed
Add type for Group, PhysicsGroup, StaticPhysicsGroup
1 parent a52831d commit 8585541

3 files changed

Lines changed: 35 additions & 2 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ var Group = new Class({
103103
*/
104104
this.isParent = true;
105105

106+
/**
107+
* A textual representation of this Game Object.
108+
* Used internally by Phaser but is available for your own custom classes to populate.
109+
*
110+
* @name Phaser.GameObjects.Group#type
111+
* @type {string}
112+
* @default 'Group'
113+
* @since 3.21.0
114+
*/
115+
this.type = 'Group';
116+
106117
/**
107118
* The class to create new group members from.
108119
*
@@ -291,7 +302,7 @@ var Group = new Class({
291302
for (var i = 0; i < config.length; i++)
292303
{
293304
var entries = this.createFromConfig(config[i]);
294-
305+
295306
output = output.concat(entries);
296307
}
297308
}

src/physics/arcade/PhysicsGroup.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var PhysicsGroup = new Class({
8787

8888
/**
8989
* The class to create new Group members from.
90-
*
90+
*
9191
* This should be either `Phaser.Physics.Arcade.Image`, `Phaser.Physics.Arcade.Sprite`, or a class extending one of those.
9292
*
9393
* @name Phaser.Physics.Arcade.Group#classType
@@ -146,6 +146,17 @@ var PhysicsGroup = new Class({
146146
}
147147

148148
Group.call(this, scene, children, config);
149+
150+
/**
151+
* A textual representation of this Game Object.
152+
* Used internally by Phaser but is available for your own custom classes to populate.
153+
*
154+
* @name Phaser.Physics.Arcade.Group#type
155+
* @type {string}
156+
* @default 'PhysicsGroup'
157+
* @since 3.21.0
158+
*/
159+
this.type = 'PhysicsGroup';
149160
},
150161

151162
/**

src/physics/arcade/StaticPhysicsGroup.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ var StaticPhysicsGroup = new Class({
9393
this.physicsType = CONST.STATIC_BODY;
9494

9595
Group.call(this, scene, children, config);
96+
97+
/**
98+
* A textual representation of this Game Object.
99+
* Used internally by Phaser but is available for your own custom classes to populate.
100+
*
101+
* @name Phaser.Physics.Arcade.Group#type
102+
* @type {string}
103+
* @default 'StaticPhysicsGroup'
104+
* @since 3.21.0
105+
*/
106+
this.type = 'StaticPhysicsGroup';
96107
},
97108

98109
/**

0 commit comments

Comments
 (0)