Skip to content

Commit a01535e

Browse files
committed
Group.add and Group.addMultiple now respect the Group.maxSize property, stopping you from over-populating a Group.
1 parent f53430e commit a01535e

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* The Scene Manager would never reach an `isBooted` state if you didn't add any Scenes into the Game Config. Fix #3553 (thanks @rgk)
1515
* Fixed issue in HTMLAudioSound where `mute` would get into a recursive loop.
1616
* Every RenderTexture would draw the same content due to a mis-use of the CanvasPool (this also impacted TileSprites). Fix #3555 (thanks @kuoruan)
17+
* Group.add and Group.addMultiple now respect the Group.maxSize property, stopping you from over-populating a Group (thanks @samme)
1718

1819
### Updates
1920

src/gameobjects/group/Group.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,11 @@ var Group = new Class({
483483
{
484484
if (addToScene === undefined) { addToScene = false; }
485485

486+
if (this.isFull())
487+
{
488+
return this;
489+
}
490+
486491
this.children.set(child);
487492

488493
if (this.createCallback)

0 commit comments

Comments
 (0)