Transition

Tily. Transition

new Transition(start, finish)

Represents a timed transition from one value to another.

Parameters
Name Type Description
start any

The starting value.

finish any

The finishing value.

Members

amount :number

The current interpolation amount between 0 and 1 (inclusive).

currentTime :number

The current time elapsed since the transition began.

easeFunction :easeFunction

The easing function to use while transitioning.

Default Value:
  • Tily.utility.lerp

finish :any

The finishing value.

finished :boolean

True if this transition has finished and can be discarded.

(nullable) finishedCallback :finishedCallback

A callback function that will be called once the transition has finished.

Default Value:
  • null

start :any

The starting value.

totalTime :number

The total amount of time that this transition should take.

Methods

update(elapsedTime) → {any}

Update the transition.

Parameters
Name Type Description
elapsedTime number

The number of seconds that have elapsed since the last update.

Returns

An interpolated value between the start and finish values.

Type
any