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

Method getBounds

packages/melonjs/src/renderable/renderable.js:563–574  ·  view source on GitHub ↗

* returns the bounding box for this renderable * @returns {Bounds} bounding box Rectangle object

()

Source from the content-addressed store, hash-verified

561 * @returns {Bounds} bounding box Rectangle object
562 */
563 getBounds() {
564 if (typeof this._bounds === "undefined") {
565 super.getBounds();
566 if (this.isFinite()) {
567 this.updateBounds();
568 } else {
569 // e.g. containers or game world can have infinite size
570 this._bounds.setMinMax(this.pos.x, this.pos.y, this.width, this.height);
571 }
572 }
573 return this._bounds;
574 }
575
576 /**
577 * get the renderable alpha channel value<br>

Callers 3

angleToMethod · 0.95
distanceToMethod · 0.95
updateBoundsMethod · 0.95

Calls 4

updateBoundsMethod · 0.95
getBoundsMethod · 0.65
isFiniteMethod · 0.45
setMinMaxMethod · 0.45

Tested by

no test coverage detected