1681-engine / index / TimelineBuilder
Abstract Class: TimelineBuilder ​
Defined in: src/core/TimelineBuilder.ts:21
The building half of Timeline: where each tween, call, gap and nested timeline goes. Kept apart from the playing half so each stays readable; nothing here runs per frame.
Extended by ​
Constructors ​
Constructor ​
new TimelineBuilder(): TimelineBuilder;Returns ​
TimelineBuilder
Properties ​
children ​
protected readonly children: TimelineChild[] = [];Defined in: src/core/TimelineBuilder.ts:23
Sorted by start; equal starts keep the order they were added in.
labels ​
protected readonly labels: Map<string, number>;Defined in: src/core/TimelineBuilder.ts:24
Accessors ​
duration ​
Get Signature ​
get duration(): number;Defined in: src/core/TimelineBuilder.ts:35
One play, ms (the longest child's end).
Returns ​
number
Methods ​
add() ​
add(child, at?): this;Defined in: src/core/TimelineBuilder.ts:103
Plays another timeline (built, not repeating forever) as one child of this one; it is no longer stepped alone.
Parameters ​
| Parameter | Type |
|---|---|
child | TimelineBuilder |
at? | TimelinePosition |
Returns ​
this
adopt() ​
abstract protected adopt(child): NestedPlay;Defined in: src/core/TimelineBuilder.ts:32
Checks child may be played by this timeline and takes it over (it stops being stepped alone).
Parameters ​
| Parameter | Type |
|---|---|
child | TimelineBuilder |
Returns ​
NestedPlay
call() ​
call(fn, at?): this;Defined in: src/core/TimelineBuilder.ts:62
Calls fn when the playhead passes at (default: the end so far), going either way.
Parameters ​
| Parameter | Type |
|---|---|
fn | () => void |
at? | TimelinePosition |
Returns ​
this
label() ​
label(name, at?): this;Defined in: src/core/TimelineBuilder.ts:72
Names a point (default: the end so far), for positions and seek.
Parameters ​
| Parameter | Type |
|---|---|
name | string |
at? | TimelinePosition |
Returns ​
this
labelTime() ​
labelTime(name): number | undefined;Defined in: src/core/TimelineBuilder.ts:78
Where a label stands, if it is set.
Parameters ​
| Parameter | Type |
|---|---|
name | string |
Returns ​
number | undefined
parallel() ​
parallel(build, at?): this;Defined in: src/core/TimelineBuilder.ts:86
Everything build adds starts together, at at (default: the end so far); a position inside is measured from the group's start. What follows the group starts at its longest child's end.
Parameters ​
| Parameter | Type |
|---|---|
build | (timeline) => void |
at? | TimelinePosition |
Returns ​
this
to() ​
to(
targets,
props,
options?
): this;Defined in: src/core/TimelineBuilder.ts:40
Tweens the numeric props of targets (one object or several), after what came before unless at says.
Parameters ​
| Parameter | Type |
|---|---|
targets | object | readonly object[] |
props | TimelineProps |
options | TimelineTweenOptions |
Returns ​
this
wait() ​
wait(ms): this;Defined in: src/core/TimelineBuilder.ts:67
ms of nothing: the next child starts that much later, and a wait at the end makes the timeline longer.
Parameters ​
| Parameter | Type |
|---|---|
ms | number |
Returns ​
this