Skip to main content

Class: Timeline

Defined in: animation/Timeline.ts:24

Extended by

Constructors

Constructor

new Timeline(): Timeline

Returns

Timeline

Properties

_startedAnimations

protected _startedAnimations: Set<Animation>

Defined in: animation/Timeline.ts:38

Track which animations have been started

Accessors

length

Get Signature

get length(): number

Defined in: animation/Timeline.ts:242

Get the number of animations in the timeline.

Returns

number

Methods

add()

add(animation, position): this

Defined in: animation/Timeline.ts:45

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:65

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:249

Clear all animations from the timeline.

Returns

this


getCurrentTime()

getCurrentTime(): number

Defined in: animation/Timeline.ts:235

Get the current playback time.

Returns

number


getDuration()

getDuration(): number

Defined in: animation/Timeline.ts:228

Get the total duration of the timeline.

Returns

number


isFinished()

isFinished(): boolean

Defined in: animation/Timeline.ts:214

Check if the timeline has finished playing.

Returns

boolean


isPlaying()

isPlaying(): boolean

Defined in: animation/Timeline.ts:221

Check if the timeline is currently playing.

Returns

boolean


pause()

pause(): this

Defined in: animation/Timeline.ts:191

Pause the timeline.

Returns

this


play()

play(): this

Defined in: animation/Timeline.ts:183

Start playing the timeline.

Returns

this


reset()

reset(): this

Defined in: animation/Timeline.ts:199

Reset the timeline to the beginning.

Returns

this


seek()

seek(time): this

Defined in: animation/Timeline.ts:123

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:145

Update the timeline by a time delta.

Parameters

dt

number

Time delta in seconds

Returns

void