Skip to main content

Class: Timeline

Defined in: animation/Timeline.ts:25

Extended by

Constructors

Constructor

new Timeline(): Timeline

Returns

Timeline

Properties

_startedAnimations

protected _startedAnimations: Set<Animation>

Defined in: animation/Timeline.ts:39

Track which animations have been started

Accessors

length

Get Signature

get length(): number

Defined in: animation/Timeline.ts:243

Get the number of animations in the timeline.

Returns

number

Methods

add()

add(animation, position): this

Defined in: animation/Timeline.ts:46

Add an animation to the timeline.

Parameters

animation

Animation

The animation to add

position

PositionParam = '>'

When to start the animation (default: '>' - after previous ends)

Returns

this


addParallel()

addParallel(animations, position): this

Defined in: animation/Timeline.ts:66

Add multiple animations to play in parallel (all start at the same time).

Parameters

animations

Animation[]

The animations to add

position

PositionParam = '>'

When to start all animations (default: '>' - after previous ends)

Returns

this


clear()

clear(): this

Defined in: animation/Timeline.ts:250

Clear all animations from the timeline.

Returns

this


getCurrentTime()

getCurrentTime(): number

Defined in: animation/Timeline.ts:236

Get the current playback time.

Returns

number


getDuration()

getDuration(): number

Defined in: animation/Timeline.ts:229

Get the total duration of the timeline.

Returns

number


isFinished()

isFinished(): boolean

Defined in: animation/Timeline.ts:215

Check if the timeline has finished playing.

Returns

boolean


isPlaying()

isPlaying(): boolean

Defined in: animation/Timeline.ts:222

Check if the timeline is currently playing.

Returns

boolean


pause()

pause(): this

Defined in: animation/Timeline.ts:192

Pause the timeline.

Returns

this


play()

play(): this

Defined in: animation/Timeline.ts:184

Start playing the timeline.

Returns

this


reset()

reset(): this

Defined in: animation/Timeline.ts:200

Reset the timeline to the beginning.

Returns

this


seek()

seek(time): this

Defined in: animation/Timeline.ts:124

Seek to a specific time in the timeline.

Parameters

time

number

The time to seek to (in seconds)

Returns

this


update()

update(dt): void

Defined in: animation/Timeline.ts:146

Update the timeline by a time delta.

Parameters

dt

number

Time delta in seconds

Returns

void