* Sets the current animation for a track by animation index, discarding any queued animations. * @param {number} trackIndex - the track index * @param {number} index - the animation index * @param {boolean} [loop=false] - If true, the animation will repeat. * @returns {TrackEntry} A track en
(trackIndex, index, loop = false)
| 473 | * @returns {TrackEntry} A track entry to allow further customization of animation playback. |
| 474 | */ |
| 475 | setAnimationByIndex(trackIndex, index, loop = false) { |
| 476 | if (index < 0 || index >= this.skeleton.data.animations.length) { |
| 477 | console.warn("Spine plugin: animation index out of range:", index); |
| 478 | return undefined; |
| 479 | } |
| 480 | return this.setAnimation( |
| 481 | trackIndex, |
| 482 | this.skeleton.data.animations[index].name, |
| 483 | loop, |
| 484 | ); |
| 485 | } |
| 486 | |
| 487 | /** |
| 488 | * Sets the current animation for a track, discarding any queued animations. |
nothing calls this directly
no test coverage detected