Class: Animation

Animation

Class to manage an animation.


new Animation(config)

Creates an animation.

Possible Configuration

  • easing : string
  • duration : number (milliseconds)
  • target : object
  • properties : object
Parameters:
Name Type Description
config config

Configuration of the animation.

Methods


observeAtTick(ratio, callback)

Allows observing on a particular percentage ratio tick.

Parameters:
Name Type Description
ratio number

The ratio of completeness between 0-1.

callback function

The function notified at the given ratio.

Returns:
Type
Observer

play()

Plays the animation forward.

Returns:
Type
Animation

playToEndAsync( [startAt])

Play the animation to the end.

Parameters:
Name Type Argument Description
startAt number <optional>

What ratio of completeness to start at. (0-1)

Returns:
Type
Promise

playToPercentageAsync(percentage)

Play to the given percentage.

Parameters:
Name Type Description
percentage number

The percentage to play to.

Returns:
Type
Promise

stop()

Stops the animation.

Returns:
Type
Animation