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.add has a new optional argument index which controls the index within the group to insert the child to. Where 0 is the bottom of the Group.
Group.addAt has been refactored to be a simple call to `Group.add`, removing lots of duplicate code in the process.
Group.create has a new optional argument `index` which controls the index within the group to insert the child to. Where 0 is the bottom of the Group. It also now makes proper use of `Group.add`, cutting down on more duplicate code.
Group.createMultiple now returns an Array containing references to all of the children that the method created.
* This call will return false if the child is not a child of this Group, or is already in the hash.
@@ -379,6 +437,10 @@ Phaser.Group.prototype.removeFromHash = function (child) {
379
437
*
380
438
* As well as an array you can also pass another Group as the first argument. In this case all of the children from that
381
439
* Group will be removed from it and added into this Group.
440
+
*
441
+
* If `Group.enableBody` is set, then a physics body will be created on the objects, so long as one does not already exist.
442
+
*
443
+
* If `Group.inputEnableChildren` is set, then an Input Handler will be created on the objects, so long as one does not already exist.
382
444
*
383
445
* @method Phaser.Group#addMultiple
384
446
* @param {DisplayObject[]|Phaser.Group} children - An array of display objects or a Phaser.Group. If a Group is given then *all* children will be moved from it.
@@ -403,56 +465,6 @@ Phaser.Group.prototype.addMultiple = function (children, silent) {
403
465
404
466
};
405
467
406
-
/**
407
-
* Adds an existing object to this group.
408
-
*
409
-
* The child is added to the group at the location specified by the index value, this allows you to control child ordering.
410
-
*
411
-
* @method Phaser.Group#addAt
412
-
* @param {DisplayObject} child - The display object to add as a child.
413
-
* @param {integer} [index=0] - The index within the group to insert the child to.
414
-
* @param {boolean} [silent=false] - If true the child will not dispatch the `onAddedToGroup` event.
415
-
* @return {DisplayObject} The child that was added to the group.
* Returns the child found at the given index within this group.
458
470
*
@@ -477,16 +489,26 @@ Phaser.Group.prototype.getAt = function (index) {
477
489
* Creates a new Phaser.Sprite object and adds it to the top of this group.
478
490
*
479
491
* Use {@link #classType} to change the type of object created.
492
+
*
493
+
* The child is automatically added to the top of the group, and is displayed above every previous child.
494
+
*
495
+
* Or if the _optional_ index is specified, the child is added at the location specified by the index value,
496
+
* this allows you to control child ordering.
497
+
*
498
+
* If `Group.enableBody` is set, then a physics body will be created on the object, so long as one does not already exist.
499
+
*
500
+
* If `Group.inputEnableChildren` is set, then an Input Handler will be created on the object, so long as one does not already exist.
480
501
*
481
502
* @method Phaser.Group#create
482
503
* @param {number} x - The x coordinate to display the newly created Sprite at. The value is in relation to the group.x point.
483
504
* @param {number} y - The y coordinate to display the newly created Sprite at. The value is in relation to the group.y point.
484
505
* @param {string|Phaser.RenderTexture|Phaser.BitmapData|Phaser.Video|PIXI.Texture} [key] - This is the image or texture used by the Sprite during rendering. It can be a string which is a reference to the Cache Image entry, or an instance of a RenderTexture, BitmapData, Video or PIXI.Texture.
485
506
* @param {string|number} [frame] - If this Sprite is using part of a sprite sheet or texture atlas you can specify the exact frame to use by giving a string or numeric index.
486
507
* @param {boolean} [exists=true] - The default exists state of the Sprite.
508
+
* @param {integer} [index] - The index within the group to insert the child to. Where 0 is the bottom of the Group.
487
509
* @return {DisplayObject} The child that was created: will be a {@link Phaser.Sprite} unless {@link #classType} has been changed.
0 commit comments