new OffsetAnimation(activeTile, start, finish, optionsopt)
Represents an offset animation for moving active tiles.
Parameters
Name | Type | Attributes | Description |
---|---|---|---|
activeTile |
Tily.ActiveTile | Tily.ActiveTileLayer | The active tile or active tile layer that this animation belongs to. |
|
start |
Tily.utility.vec2 | The starting offset. |
|
finish |
Tily.utility.vec2 | The finishing offset. |
|
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.
- Inherited From:
alternate :boolean
Whether or not this animation's direction should alternate on each repeat.
- Inherited From:
amount :number
The current interpolation amount between 0 and 1 (inclusive).
- Inherited From:
currentTime :number
The current time elapsed since the transition began.
- Inherited From:
easeFunction :easeFunction
The easing function to use while transitioning.
- Inherited From:
- Default Value:
- Tily.utility.lerp
finished :boolean
True if this transition has finished and can be discarded.
- Inherited From:
(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.
- Inherited From:
repeatCallback :function
A function to call on each repetition of the animation.
- Inherited From:
reverse :boolean
Whether or not this animation should play in reverse.
- Inherited From:
running :boolean
True if this animation is currently running, false if the animation is currently paused.
- Inherited From:
- Default Value:
- true
totalTime :number
The total amount of time that this transition should take.
- Inherited From:
Methods
update(elapsedTime)
Update the animation and set the active tile offset.
- Overrides:
Parameters
Name | Type | Description |
---|---|---|
elapsedTime |
number | The number of seconds that have elapsed since the last update. |