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

Method setCurrentAnimation

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

* set the current animation * this will always change the animation & set the frame to zero * @param {string} name - animation id * @param {string|Function} [resetAnim] - animation id to switch to when complete, or callback * @param {boolean} [preserve_dt=false] - if false will reset the ela

(name, resetAnim, preserve_dt = false)

Source from the content-addressed store, hash-verified

558 * });
559 */
560 setCurrentAnimation(name, resetAnim, preserve_dt = false) {
561 this._frameAnim.setCurrentAnimation(name, resetAnim, preserve_dt);
562 return this;
563 }
564
565 /**
566 * reverse the given or current animation if none is specified

Callers 15

constructorMethod · 0.95
playMethod · 0.95
onResetEventMethod · 0.95
sprite3d.spec.jsFile · 0.45
sprite.spec.jsFile · 0.45
gltf_model.spec.jsFile · 0.45
texture.spec.jsFile · 0.45
onCollisionStartMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected