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.

Constructor

SpineAnimation

(
  • json
  • atlas
  • path
  • textures
)

Parameters:

  • json Object
  • atlas String
  • path String
  • textures Array

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.

initialize

()

Initialize the object.

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.

toJSON

(
  • meta
)
Object

Serialize spine animation as JSON.

Parameters:

  • meta Object

Returns:

Object:

json

update

()

Update the object state, called every time before rendering into the screen.

Properties

atlas

Object

Texture atlas information.

json

Object

Animation data.

textures

Array

Array of SpineTextures used by the animation.