SpineAnimation Class

Extends spine.threejs.SkeletonMesh
Module: Animations

Spine animation object, to used with animation produced inside Esoteric spine.

Based on the official threejs runtime code available at https://github.com/EsotericSoftware/spine-runtimes.

More information abou spine available here www.esotericsoftware.com.

Methods

getAnimations

() Array

Get all available animations.

Returns:

Array:

Animations

getSkins

() Array

Get skins available for this animation.

Returns:

Array:

List of skins available for this animation.

onBeforeRender

()

Update mesh geometry from animation state before rendering.

play

()

Play animation.

setAnimation

(
  • track
  • animation
  • loop
)

Set animation from track number and name.

Parameters:

  • track Number

    Track number.

  • animation String

    Animation name.

  • loop Boolean

    If true the animation plays in loop.

setSkin

(
  • name
)

Set skin to be used by this animation

Parameters:

  • name String

    Skin name.

Properties

atlas

Object

Texture atlas information.

json

Object

Spine animation data.

textures

Array

Array of SpineTextures used by the animation.

Attributes

animation

Object

Animation currently playing, animations are split into tracks.

An animation (e.g. walk) can be composed of multiple tracks.

loop

Boolean

Indicates the loop mode of the animation if set true the animation starts again after it ends.

skin

Object

The animation can have multiple skins that define diferent sets of textures for the same animation.

track

Number

Index of the animation track playing.