Home Reference Source Repository
import AnimationPlayer from 'itowns/src/Core/AnimationPlayer.js'
public class | source

AnimationPlayer

Extends:

three~THREE.EventDispatcher → AnimationPlayer

AnimationPlayer It can play, pause or stop Animation or AnimationExpression (See below). AnimationPlayer is needed to use Animation or AnimationExpression AnimationPlayer emits events :

  - for each animation's frame;
  - when Animation is stopped
  - when Animation is ending

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public

id: *

public
public

promise: *

public

resolve: *

public
public

state: *

public

Method Summary

Public Methods
public

frame()

{ this function is executed with each frame }

public

isEnded(): *

public

isPlaying(): *

public

isStopped(): *

public

{ Start animation } this function play one animation.

public

playLater(animation: Animation, waitingTime: Number): *

{ The animation is played after a number of frames }

public

{ Stop current animation }

Public Constructors

public constructor() source

Public Members

public animation: * source

public id: * source

public keyframe: number source

public promise: * source

public resolve: * source

public resolveWait: * source

public state: * source

public waitTimer: * source

Public Methods

public frame() source

{ this function is executed with each frame }

public isEnded(): * source

Return:

*

public isPlaying(): * source

Return:

*

public isStopped(): * source

Return:

*

public play(The: Animation): Promise source

{ Start animation } this function play one animation. If another animation is playing, it's stopped and the new animation is played

Params:

NameTypeAttributeDescription
The Animation

animation to play

Return:

Promise

Promise is resolved when animation is stopped or finished

public playLater(animation: Animation, waitingTime: Number): * source

{ The animation is played after a number of frames }

Params:

NameTypeAttributeDescription
animation Animation

The animation to play

waitingTime Number

The waiting time before start animation (time in frame)

Return:

*

public stop(): Promise source

{ Stop current animation }

Return:

Promise

Promise is resolved when animation is stopped or finished