Skip to content

Commit 04384f7

Browse files
committed
Add Group#name
1 parent 77626d8 commit 04384f7

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

src/gameobjects/group/Group.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,17 @@ var Group = new Class({
113113
*/
114114
this.classType = GetFastValue(config, 'classType', Sprite);
115115

116+
/**
117+
* The name of this group.
118+
* Empty by default and never populated by Phaser, this is left for developers to use.
119+
*
120+
* @name Phaser.GameObjects.Group#name
121+
* @type {string}
122+
* @default ''
123+
* @since 3.18.0
124+
*/
125+
this.name = GetFastValue(config, 'name', '');
126+
116127
/**
117128
* Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method
118129
* (which may update any members).

src/gameobjects/group/typedefs/GroupConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* @since 3.0.0
44
*
55
* @property {?Function} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}.
6+
* @property {?string} [name=''] - Sets Sets {@link Phaser.GameObjects.Group#name}.
67
* @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}.
78
* @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}.
89
* @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.

0 commit comments

Comments
 (0)