Timeline
final class Timeline
Extends: BaseTween<Timeline>
Package: dev.joid.lib.animation.tween · Module: core · Source: Timeline.java
Plays tweens and other timelines one after the other or all together, as one tween.
Description
Section titled “Description”Timeline.sequence() plays its children in order; Timeline.parallel() plays them together and lasts as long as the longest.
beginSequence() and beginParallel() open a nested block that end() closes.
A timeline takes its children before start(): after it, push(...), pushPause(...), begin...() and end() throw an IllegalStateException.
At the start, a child that repeats forever throws an IllegalArgumentException and a block left open throws an IllegalStateException.
Animate values of your own chains two tweens in a sequence that plays back and forth forever.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
Timeline | sequence() factory | Creates a timeline that plays its children one after the other. |
Timeline | parallel() factory | Creates a timeline that plays its children together. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
this | push(Tween tween) fluent | Adds tween to the open block, then returns this timeline. |
this | push(Timeline timeline) fluent | Adds timeline to the open block, then returns this timeline. |
this | pushPause(float time) fluent | Adds a wait of time ms to the open block, then returns this timeline. |
this | beginSequence() fluent | Opens a nested block whose children play one after the other, then returns this timeline. |
this | beginParallel() fluent | Opens a nested block whose children play together, then returns this timeline. |
this | end() fluent | Closes the last block opened, then returns this timeline. |
List<BaseTween<?>> | getChildren() | Returns the children of the top level, read-only; a nested block is one child. |
Inherited from BaseTween (25)
getFullDuration · isFinished · getDelay · isYoyo · getRepeatCount · getDuration · getRepeatDelay · getStep · isPaused · getCurrentTime · isStarted · isInitialized · getUserData · start · build · kill · pause · resume · delay · repeat · repeatYoyo · userData · forceToStart · forceToEnd · update
Events
Section titled “Events”Inherited from BaseTween (8)
onStart · onIterationStart · onIterationEnd · onComplete · onReverseStart · onReverseIterationStart · onReverseIterationEnd · onReverseComplete
Creation details
Section titled “Creation details”sequence
Section titled “sequence”Timeline sequence() factory
Creates a timeline that plays its children one after the other.
parallel
Section titled “parallel”Timeline parallel() factory
Creates a timeline that plays its children together.
Method details
Section titled “Method details”this push(Tween tween) fluent
Adds tween to the open block, then returns this timeline.
this push(Timeline timeline) fluent
Throws:
IllegalArgumentException: The pushed timeline still has an open beginSequence() or beginParallel(), close each one with end() before pushing it
Adds timeline to the open block, then returns this timeline.
Throws an IllegalArgumentException when timeline still has a block open.
pushPause
Section titled “pushPause”this pushPause(float time) fluent
Adds a wait of time ms to the open block, then returns this timeline.
beginSequence
Section titled “beginSequence”this beginSequence() fluent
Opens a nested block whose children play one after the other, then returns this timeline.
beginParallel
Section titled “beginParallel”this beginParallel() fluent
Opens a nested block whose children play together, then returns this timeline.
this end() fluent
Throws:
IllegalStateException: The timeline has no open beginSequence() or beginParallel() to close, remove this end()
Closes the last block opened, then returns this timeline.
Throws an IllegalStateException when no block is open.
getChildren
Section titled “getChildren”List<BaseTween<?>> getChildren()
Returns the children of the top level, read-only; a nested block is one child.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
