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

Method setRegion

packages/melonjs/src/renderable/sprite.js:614–617  ·  view source on GitHub ↗

* change the current texture atlas region for this sprite * @see Texture.getRegion * @param {object} region - typically returned through me.Texture.getRegion() * @returns {Sprite} Reference to this object for method chaining * @example * // change the sprite to "shadedDark13.png"; * mySp

(region)

Source from the content-addressed store, hash-verified

612 * mySprite.setRegion(mytexture.getRegion("shadedDark13.png"));
613 */
614 setRegion(region) {
615 this._frameAnim.setRegion(region);
616 return this;
617 }
618
619 /**
620 * Apply the current frame's texture region to this sprite's geometry: swap

Callers 9

constructorMethod · 0.95
sprite3d.spec.jsFile · 0.45
onClickMethod · 0.45
onClickMethod · 0.45
onClickMethod · 0.45
onReleaseMethod · 0.45
setSelectedMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected