Animation

Tily. Animation

new Animation(activeTile, start, finish, optionsopt)

Base class for active tile animations.

Parameters
Name Type Attributes Description
activeTile Tily.ActiveTile | Tily.ActiveTileLayer

The active tile or active tile layer that this animation belongs to.

start any

The starting value.

finish any

The finishing value.

options AnimationOptions <optional>

An optional options object for configuring the animation.

Extends

Members

activeTile :Tily.ActiveTile|Tily.ActiveTileLayer

The active tile or active tile layer that this animation belongs to.

alternate :boolean

Whether or not this animation's direction should alternate on each repeat.

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

repeat :boolean

Whether or not this animation should repeat until stopped or only play once.

repeatCallback :function

A function to call on each repetition of the animation.

reverse :boolean

Whether or not this animation should play in reverse.

running :boolean

True if this animation is currently running, false if the animation is currently paused.

Default Value:
  • true

start :any

The starting value.

Inherited From:

totalTime :number

The total amount of time that this transition should take.

Inherited From:

Methods

pause()

Pause this animation.

reset()

Reset this animation.

run()

Un-pause this animation.

update(elapsedTime) → {number}

Update the animation.

Overrides:
Parameters
Name Type Description
elapsedTime number

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

Returns

The animation interpolation value between 0 and 1.

Type
number