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

Method translate

packages/melonjs/src/renderable/renderable.js:755–760  ·  view source on GitHub ↗

* Translate the renderable by the specified offset. * @param {number} x - x offset * @param {number} [y=0] - y offset * @param {number} [z=0] - z offset * @returns {Renderable} Reference to this object for method chaining

(x, y = 0, z = 0)

Source from the content-addressed store, hash-verified

753 * @returns {Renderable} Reference to this object for method chaining
754 */
755 translate(x, y = 0, z = 0) {
756 this.currentTransform.translate(x, y, z);
757 this.updateBounds();
758 this.isDirty = true;
759 return this;
760 }
761
762 /**
763 * update function (automatically called by melonJS).

Callers 8

updateBoundsMethod · 0.45
preDrawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
drawMethod · 0.45
constructorMethod · 0.45
preDrawMethod · 0.45

Calls 1

updateBoundsMethod · 0.95

Tested by

no test coverage detected