Mirror Engine
V7
How To
Mirror Engine Logo

Mirror Engine API


Mirror Engine API / AnimEvents

Class: AnimEvents

AnimEvents stores a sorted array of animation events which should fire sequentially during the playback of an AnimTrack.

Constructors

new AnimEvents()

new AnimEvents(events: any[]): AnimEvents

Create a new AnimEvents instance.

Parameters

events

any[]

An array of animation events.

Returns

AnimEvents

Example

const events = new AnimEvents([
  {
    name: 'my_event',
    time: 1.3, // given in seconds
    // any additional properties added are optional and will be available in the EventHandler callback's event object
    myProperty: 'test',
    myOtherProperty: true
  }
])
animTrack.events = events
Mirror Engine Logo