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.
Description
Section titled “Description”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.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| TweenManager() | Creates an empty manager that is not paused. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
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. |
Creation details
Section titled “Creation details”TweenManager
Section titled “TweenManager”TweenManager()
Creates an empty manager that is not paused.
Method details
Section titled “Method details”this add(BaseTween<?> object) fluent
Adds object once and starts it, then returns this manager; adding it again starts it again.
killAll
Section titled “killAll”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.
resume
Section titled “resume”this resume() fluent
Lets the updates advance again, then returns this manager.
update
Section titled “update”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.
getRunningTweensCount
Section titled “getRunningTweensCount”int getRunningTweensCount()
Returns the number of tweens held, those inside timelines included.
getRunningTimelinesCount
Section titled “getRunningTimelinesCount”int getRunningTimelinesCount()
Returns the number of timelines held, the nested ones included.
getObjects
Section titled “getObjects”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
