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

Method play

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

* Play an animation, or resume the current animation / video. A shorthand: * call with an animation id to switch to (and start) it, or with no argument * to resume after Sprite#pause. Always clears the paused state. The * options mirror Sprite#setCurrentAnimation and the 3D *

(name, options)

Source from the content-addressed store, hash-verified

422 * sprite.play(); // resume
423 */
424 play(name, options) {
425 this.animationpause = false;
426 // `name` only applies to frame animations; a video sprite just resumes
427 if (name !== undefined && !this.isVideo) {
428 this.setCurrentAnimation(name, options);
429 }
430 return this;
431 }
432
433 /**
434 * Pause the current animation or video, freezing the current frame. Resume

Callers 15

createGameFunction · 0.95
resumeTrackFunction · 0.45
playFunction · 0.45
resumeFunction · 0.45
updateMethod · 0.45
sprite.spec.jsFile · 0.45
gltf_model.spec.jsFile · 0.45
audio.spec.jsFile · 0.45
onCollisionStartMethod · 0.45
updateMethod · 0.45
hurtMethod · 0.45

Calls 1

setCurrentAnimationMethod · 0.95

Tested by

no test coverage detected