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

Method setAnimation

packages/spine-plugin/src/Spine.js:497–504  ·  view source on GitHub ↗

* Sets the current animation for a track, discarding any queued animations. * @param {number} trackIndex - the track index * @param {string} name - the animation name * @param {boolean} [loop=false] - If true, the animation will repeat. * @returns {TrackEntry} A track entry to allow further

(trackIndex, name, loop = false)

Source from the content-addressed store, hash-verified

495 * spineAlien.setAnimation(0, "death", true);
496 */
497 setAnimation(trackIndex, name, loop = false) {
498 this.currentTrack = this.animationState.setAnimation(
499 trackIndex,
500 name,
501 loop,
502 );
503 return this.currentTrack;
504 }
505
506 /**
507 * Return true if the given animation name is the current running animation for the current track.

Callers 2

setAnimationByIndexMethod · 0.95
loadCharacterFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected