OffsetTransition

Tily. OffsetTransition

new OffsetTransition(start, finish, optionsopt)

Represents an offset position transition for moving the buffer camera with a movement animation.

Parameters
Name Type Attributes Description
start Tily.utility.vec2

The starting offset.

finish Tily.utility.vec2

The finishing offset.

options TransitionOptions <optional>

An optional options object for configuring the transition.

Extends

Members

amount :number

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

Inherited From:

currentTime :number

The current time elapsed since the transition began.

Overrides:

easeFunction :easeFunction

The easing function to use while transitioning.

Inherited From:
Default Value:
  • Tily.utility.lerp

finish :any

The finishing value.

Inherited From:

finished :boolean

True if this transition has finished and can be discarded.

Overrides:

(nullable) finishedCallback :finishedCallback

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

Inherited From:
Default Value:
  • null

start :any

The starting value.

Inherited From:

totalTime :number

The total amount of time that this transition should take.

Inherited From:

Methods

update(elapsedTime) → {number}

Update the transition.

Overrides:
Parameters
Name Type Description
elapsedTime number

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

Returns

An interpolated offset value between the start and finish offsets.

Type
number