Physics.P2.BodyDebug#addAt()

addAt(child, index, silent) → {DisplayObject}

Adds an existing object to this group.

The child is added to the group at the location specified by the index value, this allows you to control child ordering.

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

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

Parameters
Name Type Argument Default Description
child DisplayObject

The display object to add as a child.

index integer <optional>
0

The index within the group to insert the child to.

silent boolean <optional>
false

If true the child will not dispatch the onAddedToGroup event.

Returns

The child that was added to the group.

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

Please login to continue.