Repository
public class |source

Animation

Extends:

* → Animation

The Animation class provides a simple way to tween object properties

Example:

   //TODO

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

delay: *

public
public

easing: *

public

from: *

public
public
public
public
public

onStop: *

public
public

repeat: *

public

target: *

public

to: *

public

yoyo: *

Private Members
private
private
private

_time: *

private

Method Summary

Public Methods
public

chain(animation: *)

Chain another animation once this one is finished

public

play()

Play the animation

public

Resume the animation

public

Rewind the animation back to its starting values

public

Setup

public

stop()

Stop the animation

public

update(time: *)

Update the properties according to the elapsed time

Public Constructors

public constructor(params: Object) source

Params:

NameTypeAttributeDescription
paramsObject

The parameters object

params.targetObject

The object whose propoerties are to be animated

params.fromObject
  • optional

An object indicating the start values of the properties to animate, defaults to the values of the target

params.toObject

An object indicating the finish values of the properties to animate

params.durationNumber

The animation duration in milliseconds

params.easingFunction
  • optional
  • default: Animation.Easing.linear

An easing function to use

params.repeatNumber
  • optional
  • default: 0

The number of times the animation should be repeated, set to Infinity to repeat indefinately

params.yoyoBoolean
  • optional
  • default: false

If set to true and repeat is greater than 1, the animation will play in reverse once it reached the end

params.delayNumber
  • optional
  • default: 0

The number of milliseconds to wait for before starting the animation

params.timeTime
  • optional

The Time instance to use for this Animation Component

params.onStartFunction
  • optional

A callback to be called when the animation starts

params.onUpdateFunction
  • optional

A callback to be called each time the animation is updated

params.onRestartFunction
  • optional

A callback to be called each time the animation is repeated once it reached the end if repeat is greater than 1

params.onStopFunction
  • optional

A callback to be called when the animation is stopped

params.onResumeFunction
  • optional

A callback to be called when the animation is resumed

params.onFinishFunction
  • optional

A callback to be called when the animation reaches the end and no repetition is pending

Public Members

public delay: * source

public duration: * source

public easing: * source

public from: * source

public onFinish: * source

public onRestart: * source

public onResume: * source

public onStart: * source

public onStop: * source

public onUpdate: * source

public repeat: * source

public target: * source

public to: * source

public yoyo: * source

Private Members

private _direction: number source

private _isPlaying: boolean source

private _time: * source

private _timesPlayed: number source

Public Methods

public chain(animation: *) source

Chain another animation once this one is finished

Params:

NameTypeAttributeDescription
animation*

public play() source

Play the animation

public resume() source

Resume the animation

public rewind() source

Rewind the animation back to its starting values

public setup() source

Setup

public stop() source

Stop the animation

public update(time: *) source

Update the properties according to the elapsed time

Params:

NameTypeAttributeDescription
time*