You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Group.createMultiple can now accept Arrays for both the key and frame arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples.
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -391,6 +391,7 @@ You can read all about the philosophy behind Lazer [here](http://phaser.io/news/
391
391
* Group.createMultiple now returns an Array containing references to all of the children that the method created.
392
392
* Cache.getJSON will now return an Array if the `key` you provided points to an array instead of an Object (thanks @drhayes#2552#2551)
393
393
* Phaser.Matrix if passed a 0 value would consider it falsy, and replace it with the default by mistake. It now checks if the arguments are `undefined` or `null` and only then sets the defaults (thanks mmcs)
394
+
* Group.createMultiple can now accept Arrays for both the `key` and `frame` arguments. This allows you to create multiple sprites using each key and/or frame in the arrays, which is a great and quick way to build diverse Groups. See the JSDocs for complete details and code examples.
* The above will create 20 'diamonds' of frame 0, 20 with frame 1 and 20 with frame 2.
604
+
* It will then create 20 'balls' of frame 0, 20 with frame 1 and 20 with frame 2.
605
+
* In total it will have created 120 sprites.
580
606
*
581
607
* By default the Sprites will have their `exists` property set to `false`, and they will be
582
608
* positioned at 0x0, relative to the `Group.x / y` values.
@@ -587,22 +613,42 @@ Phaser.Group.prototype.create = function (x, y, key, frame, exists, index) {
587
613
*
588
614
* @method Phaser.Group#createMultiple
589
615
* @param {integer} quantity - The number of Sprites to create.
590
-
* @param {string} key - The Game.cache key of the image that this Sprite will use.
591
-
* @param {integer|string} [frame] - If the Sprite image contains multiple frames you can specify which one to use here.
616
+
* @param {string|array} key - The Cache key of the image that the Sprites will use. Or an Array of keys. See the description for details on how the quantity applies when arrays are used.
617
+
* @param {integer|string|array} [frame=0] - If the Sprite image contains multiple frames you can specify which one to use here. Or an Array of frames. See the description for details on how the quantity applies when arrays are used.
592
618
* @param {boolean} [exists=false] - The default exists state of the Sprite.
593
619
* @return {array} An array containing all of the Sprites that were created.
0 commit comments