Show:

A method of interpolating between start and end values with an easing curve.

Constructor

Transitions.Tween

(
  • value
)
private

Parameters:

Item Index

Properties

Methods

deregister

(
  • name
)
Boolean static

Remove curve from internal registry. Undoes work of register.

Parameters:

  • name String

    Name dictionary key

Returns:

Boolean:

False if key doesn't exist

get

() Number | Number[]

Get current value.

Returns:

getCurves

() Object static

Retrieve all registered curves.

Returns:

getVelocity

() Number | Number[]

Get current velocity

Returns:

halt

()

Halt transition at current state and erase all pending actions.

register

(
  • name
  • curve
)
Boolean static

A way of registering custom easing curves by name. Curves are functions that take a number between 0 and 1 and return a number (often between 0 and 1, but can over/under shoot).

Parameters:

  • name String

    Identifying name

  • curve Function

    Function defined on the domain [0,1]

Returns:

Boolean:

False if key is taken, else true

reset

(
  • value
  • [velocity]
)

Reset the value and velocity of the transition.

Parameters:

set

(
  • endValue
  • [transition]
)

Set new value to transition to.

Parameters:

  • endValue Number | Number[]

    End value

  • [transition] Object optional

    Transition object of type {duration: number, curve: name}

update

()

Update the transition in time.

Properties

CURVES

Object static

Default easing curves.

Sub-properties:

  • linear Function

    Linear interpolation

  • easeIn Function

    EaseIn interpolation. Deceleration from zero velocity.

  • easeInCubic Function

    Cubic interpolation. Acceleration from zero velocity.

  • easeOut Function

    EaseOut interpolation. Acceleration from zero velocity.

  • easeOutCubic Function

    Cubic interpolation. Deceleration from zero velocity.

  • easeOutWall Object

    Interpolation with wall boundary.

  • easeInOut Function

    EaseInOut interpolation. Acceleration then deceleration.

  • easeInOutCubic Function

    Cubic interpolation. Acceleration then deceleration.