Physics.P2.BodyDebug#addMultiple()

addMultiple(children, silent) → {Array.<DisplayObject> | Phaser.Group}

Adds an array of existing Display Objects to this Group.

The Display Objects are automatically added to the top of this Group, and will render on-top of everything already in this Group.

As well as an array you can also pass another Group as the first argument. In this case all of the children from that
Group will be removed from it and added into this Group.

If Group.enableBody is set, then a physics body will be created on the objects, so long as one does not already exist.

If Group.inputEnableChildren is set, then an Input Handler will be created on the objects, so long as one does not already exist.

Parameters
Name Type Argument Default Description
children Array.<DisplayObject> | Phaser.Group

An array of display objects or a Phaser.Group. If a Group is given then all children will be moved from it.

silent boolean <optional>
false

If true the children will not dispatch the onAddedToGroup event.

Returns

The array of children or Group of children that were added to this Group.

Inherited From
Source code: core/Group.js (Line 489)
doc_phaser
2017-02-14 11:02:43
Comments
Leave a Comment

Please login to continue.