From 04384f78a63cc9ec43492130eb37332873a553a4 Mon Sep 17 00:00:00 2001 From: samme Date: Tue, 4 Jun 2019 09:33:08 -0700 Subject: [PATCH] Add Group#name --- src/gameobjects/group/Group.js | 11 +++++++++++ src/gameobjects/group/typedefs/GroupConfig.js | 1 + 2 files changed, 12 insertions(+) diff --git a/src/gameobjects/group/Group.js b/src/gameobjects/group/Group.js index 3f154801a..3455b6470 100644 --- a/src/gameobjects/group/Group.js +++ b/src/gameobjects/group/Group.js @@ -113,6 +113,17 @@ var Group = new Class({ */ this.classType = GetFastValue(config, 'classType', Sprite); + /** + * The name of this group. + * Empty by default and never populated by Phaser, this is left for developers to use. + * + * @name Phaser.GameObjects.Group#name + * @type {string} + * @default '' + * @since 3.18.0 + */ + this.name = GetFastValue(config, 'name', ''); + /** * Whether this group runs its {@link Phaser.GameObjects.Group#preUpdate} method * (which may update any members). diff --git a/src/gameobjects/group/typedefs/GroupConfig.js b/src/gameobjects/group/typedefs/GroupConfig.js index 757b486f4..6eed6d588 100644 --- a/src/gameobjects/group/typedefs/GroupConfig.js +++ b/src/gameobjects/group/typedefs/GroupConfig.js @@ -3,6 +3,7 @@ * @since 3.0.0 * * @property {?Function} [classType=Sprite] - Sets {@link Phaser.GameObjects.Group#classType}. + * @property {?string} [name=''] - Sets Sets {@link Phaser.GameObjects.Group#name}. * @property {?boolean} [active=true] - Sets {@link Phaser.GameObjects.Group#active}. * @property {?number} [maxSize=-1] - Sets {@link Phaser.GameObjects.Group#maxSize}. * @property {?string} [defaultKey=null] - Sets {@link Phaser.GameObjects.Group#defaultKey}.