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

Method getNextChild

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

* Returns the next child within the container or undefined if none * @param {Renderable|Entity|Sprite|Collectable|Trigger|Draggable|DropTarget|NineSliceSprite|ImageLayer|ColorLayer|Light2d|UIBaseElement|UISpriteElement|UITextButton|Text|BitmapText} child - The child object * @returns {Renderable

(child)

Source from the content-addressed store, hash-verified

578 * @returns {Renderable} child
579 */
580 getNextChild(child) {
581 const index = this.getChildren().indexOf(child) + 1;
582 if (index >= 0 && index < this.getChildren().length) {
583 return this.getChildAt(index);
584 }
585 return undefined;
586 }
587
588 /**
589 * Returns true if contains the specified Child

Callers

nothing calls this directly

Calls 2

getChildrenMethod · 0.95
getChildAtMethod · 0.95

Tested by

no test coverage detected