Web Player API - Timelines

Each group holds a timelines instance. This is a collection of internal timeline data.

Not to confuse with GSAP timelines, these timelines contain data only (no animation logic)

In most cases you won't need to reference this timelines instance directly. Using the spirit.create() or spirit.load() should cover most scenarios.

Get group.timelines

import { create } from 'spiritjs'

// create groups
const groups = create(data /* from Spirit Studio clipboard */)

// get group
const group = groups.get('ghost')

// get timelines
const timelines = group.timelines

Iterate

timelines.each(timeline => {

})

Get timeline by element

const timeline = timelines.get(
  document.querySelector('.container')
)

Events

You can listen to the following events:

// add timeline
timelines.on('add', () => {})

// remove timeline
timelines.on('remove', () => {})

results matching ""

    No results matching ""