new PSVAnimation( options )

Interpolation helper for animations

Description

Implements the Promise API with an additional "cancel" method. The promise is resolved when the animation is complete and rejected if the animation is cancelled.

Parameters
Name Type Description
options Object
Name Type Attributes Default Description
properties Array.<Object>
properties[].start number
properties[].end number
duration int
delay int <optional>
0
easing string <optional>
'linear'
onTick PSVAnimation.OnTick

called on each frame

Details

Methods


cancel()

Cancels the animation

Details

catch( onRejected ) → {PSVAnimation}

Alias to .then(null, onRejected)

Parameters
Name Type Description
onRejected function

Called when the animation has been cancelled

Returns
Details

finally( onFinally ) → {PSVAnimation}

Alias to .then(onFinally, onFinally)

Parameters
Name Type Description
onFinally function

Called when the animation is either complete or cancelled

Returns
Details

then( onFulfilled, onRejected ) → {PSVAnimation}

Animation chaining

Parameters
Name Type Description
onFulfilled function

Called when the animation is complete, can return a new animation

onRejected function

Called when the animation is cancelled

Returns
Details

Type Definitions


OnTick( properties, progress )

Parameters
Name Type Description
properties Array.<Object>

current values

progress float

0 to 1

Details
function