MCPcopy Create free account
hub / github.com/melonjs/melonJS / removeChild

Method removeChild

packages/melonjs/src/renderable/container.js:776–782  ·  view source on GitHub ↗

* Invokes the removeChildNow in a defer, to ensure the child is removed safely after the update & draw stack has completed. * if the given child implements an onDeactivateEvent() method, that method will be called once the child is removed from this container. * @param {Renderable|Sprite|Co

(child, keepalive)

Source from the content-addressed store, hash-verified

774 * @param {boolean} [keepalive=false] - true to prevent calling child.destroy()
775 */
776 removeChild(child, keepalive) {
777 if (this.hasChild(child)) {
778 defer(deferredRemove, this, child, keepalive);
779 } else {
780 throw new Error("Child is not mine.");
781 }
782 }
783
784 /**
785 * Removes (and optionally destroys) a child from the container.<br>

Callers 15

updateMethod · 0.80
updateMethod · 0.80
destroyMethod · 0.80
#cleanupMethod · 0.80
container.spec.jsFile · 0.80
trigger.spec.jsFile · 0.80
sprite.spec.jsFile · 0.80
font.spec.jsFile · 0.80
destroyMethod · 0.80
createExampleComponentFunction · 0.80

Calls 2

hasChildMethod · 0.95
deferFunction · 0.90

Tested by

no test coverage detected