Skip to content

Commit 70b8bfe

Browse files
committed
Add children after configuration
Ensures the create handler is called
1 parent d6e8600 commit 70b8bfe

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/gameobjects/group/Group.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var Group = new Class({
9191
* @type {Phaser.Structs.Set.<Phaser.GameObjects.GameObject>}
9292
* @since 3.0.0
9393
*/
94-
this.children = new Set(children);
94+
this.children = new Set();
9595

9696
/**
9797
* A flag identifying this object as a group.
@@ -236,6 +236,11 @@ var Group = new Class({
236236
*/
237237
this.internalRemoveCallback = GetFastValue(config, 'internalRemoveCallback', null);
238238

239+
if (children)
240+
{
241+
this.addMultiple(children);
242+
}
243+
239244
if (config)
240245
{
241246
this.createMultiple(config);

0 commit comments

Comments
 (0)