Group#replace()

replace(oldChild, newChild) → {any}

Replaces a child of this Group with the given newChild. The newChild cannot be a member of this Group.

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 Description
oldChild any

The child in this group that will be replaced.

newChild any

The child to be inserted into this group.

Returns
any -

Returns the oldChild that was replaced within this group.

Source code: core/Group.js (Line 1065)
doc_phaser
2017-02-14 10:51:42
Comments
Leave a Comment

Please login to continue.