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

Method setAnimationFrame

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

* force the current animation frame index. * @param {number} [index=0] - animation frame index * @returns {Sprite} Reference to this object for method chaining * @example * // reset the current animation to the first frame * this.setAnimationFrame();

(index = 0)

Source from the content-addressed store, hash-verified

673 * this.setAnimationFrame();
674 */
675 setAnimationFrame(index = 0) {
676 this._frameAnim.setAnimationFrame(index);
677 return this;
678 }
679
680 /**
681 * return the current animation frame index.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected