Class: MasterTimeline
Defined in: animation/MasterTimeline.ts:23
Extends
Constructors
Constructor
new MasterTimeline():
MasterTimeline
Returns
MasterTimeline
Inherited from
Properties
_startedAnimations
protected_startedAnimations:Set<Animation>
Defined in: animation/Timeline.ts:38
Track which animations have been started
Inherited from
Accessors
length
Get Signature
get length():
number
Defined in: animation/Timeline.ts:242
Get the number of animations in the timeline.
Returns
number
Inherited from
segmentCount
Get Signature
get segmentCount():
number
Defined in: animation/MasterTimeline.ts:248
Get the segment count.
Returns
number
Methods
add()
add(
animation,position):this
Defined in: animation/Timeline.ts:45
Add an animation to the timeline.
Parameters
animation
The animation to add
position
PositionParam = '>'
When to start the animation (default: '>' - after previous ends)
Returns
this
Inherited from
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
The animations to add
position
PositionParam = '>'
When to start all animations (default: '>' - after previous ends)
Returns
this
Inherited from
addSegment()
addSegment(
animations):Segment
Defined in: animation/MasterTimeline.ts:127
Add a segment containing one or more parallel animations. Returns the segment's start time (for the recorder to resolve).
Parameters
animations
Returns
addWaitSegment()
addWaitSegment(
duration):Segment
Defined in: animation/MasterTimeline.ts:157
Add a wait (pause) segment with no animations.
Parameters
duration
number
Returns
clear()
clear():
this
Defined in: animation/Timeline.ts:249
Clear all animations from the timeline.
Returns
this
Inherited from
getCurrentSegment()
getCurrentSegment():
Segment
Defined in: animation/MasterTimeline.ts:198
Get the currently-active segment based on _currentTime.
Returns
getCurrentTime()
getCurrentTime():
number
Defined in: animation/Timeline.ts:235
Get the current playback time.
Returns
number
Inherited from
getDuration()
getDuration():
number
Defined in: animation/Timeline.ts:228
Get the total duration of the timeline.
Returns
number
Inherited from
getSegmentAtTime()
getSegmentAtTime(
time):Segment
Defined in: animation/MasterTimeline.ts:186
Get the segment at the given time.
Parameters
time
number
Returns
getSegments()
getSegments(): readonly
Segment[]
Defined in: animation/MasterTimeline.ts:179
Get all segments.
Returns
readonly Segment[]
isFinished()
isFinished():
boolean
Defined in: animation/Timeline.ts:214
Check if the timeline has finished playing.
Returns
boolean
Inherited from
isPlaying()
isPlaying():
boolean
Defined in: animation/Timeline.ts:221
Check if the timeline is currently playing.
Returns
boolean
Inherited from
nextSegment()
nextSegment():
Segment
Defined in: animation/MasterTimeline.ts:206
Seek to the start of the next segment. Returns the segment seeked to, or null if already at the end.
Returns
pause()
pause():
this
Defined in: animation/Timeline.ts:191
Pause the timeline.
Returns
this
Inherited from
play()
play():
this
Defined in: animation/Timeline.ts:183
Start playing the timeline.
Returns
this
Inherited from
prevSegment()
prevSegment():
Segment
Defined in: animation/MasterTimeline.ts:223
Seek to the start of the previous segment (or beginning of current). If we're more than 0.5s into the current segment, seeks to its start. Otherwise seeks to the previous segment's start.
Returns
reset()
reset():
this
Defined in: animation/MasterTimeline.ts:117
Override reset to use seek(0) so future mobjects are hidden.
Returns
this
Overrides
seek()
seek(
time):this
Defined in: animation/MasterTimeline.ts:43
Override seek to always reset ALL animations before re-applying. The base Timeline only resets future animations on backward seek, which leaves already-finished animations in their final state (e.g. a FadeOut'd mobject stays invisible when scrubbing back).
Parameters
time
number
Returns
this
Overrides
update()
update(
dt):void
Defined in: animation/MasterTimeline.ts:84
Override update to restore opacity for mobjects whose introducing segment starts during this tick. seek() hides future mobjects by setting opacity=0; this restores them exactly when playback crosses their segment boundary (not every frame).
Parameters
dt
number
Returns
void