Skip to content

TweenManager

final class TweenManager
Package: dev.joid.lib.animation.tween · Module: core · Source: TweenManager.java

Holds tweens and timelines and advances them together when you update it.

Use one when code of yours already runs at each frame, for example UI.update(): call update(...) there with the time elapsed since the previous frame, in ms. A TweenAnimator needs no manager. Its methods can be called from several threads. Animate values of your own advances one in the update() of the UI that owns it.

ReturnsSignatureSummary
TweenManager()Creates an empty manager that is not paused.

ReturnsSignatureSummary
thisadd(BaseTween<?> object) fluentAdds object once and starts it, then returns this manager; adding it again starts it again.
thiskillAll() fluentKills every tween and timeline held, then returns this manager.
thispause() fluentStops the updates from advancing anything, then returns this manager.
thisresume() fluentLets the updates advance again, then returns this manager.
voidupdate(float delta)Removes the finished objects, then advances the others by delta ms, backward and in reverse order when delta is negative.
intsize()Returns the number of objects held.
intgetRunningTweensCount()Returns the number of tweens held, those inside timelines included.
intgetRunningTimelinesCount()Returns the number of timelines held, the nested ones included.
List<BaseTween<?>>getObjects()Returns a read-only copy of the objects held.

TweenManager()

Creates an empty manager that is not paused.

this add(BaseTween<?> object) fluent

Adds object once and starts it, then returns this manager; adding it again starts it again.

this killAll() fluent

Kills every tween and timeline held, then returns this manager.

this pause() fluent

Stops the updates from advancing anything, then returns this manager.

this resume() fluent

Lets the updates advance again, then returns this manager.

void update(float delta)

Removes the finished objects, then advances the others by delta ms, backward and in reverse order when delta is negative.

int size()

Returns the number of objects held.

int getRunningTweensCount()

Returns the number of tweens held, those inside timelines included.

int getRunningTimelinesCount()

Returns the number of timelines held, the nested ones included.

List<BaseTween<?>> getObjects()

Returns a read-only copy of the objects held.


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

Report a problem with this page