Class TweenEngine
- All Implemented Interfaces:
ILaunchable, IUpdateable
The TweenEngine is the central manager for Tweens. It tracks all current Tween instances and applies their
TweenEquation with every
GameLoop update.-
Field Summary
Fields inherited from interface IUpdateable
DEFAULT_UPDATE_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAttempts to get a previously registeredTweenor registers a new one.Gets the map of registeredTweens.voidRemoves all Tweens associated with the givenTweenabletarget.voidLooks for a registered Tween instance with the given target and type.Looks for a registered Tween instance with the given target and type.Looks for a registered Tween instance with the given target and type.voidstart()Start.Starts a new Tween.Looks for a registered Tween instance with the given target and type.voidTerminate.voidupdate()Updates all registered Tweens by applying theTweenEquation.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IUpdateable
getUpdatePriority
-
Constructor Details
-
TweenEngine
public TweenEngine()Instantiates a newTweenEngine.
-
-
Method Details
-
start
Starts a new Tween. If a Tween is already registered for theTweenablewith the givenTweenType, it is restarted with the given duration.- Parameters:
target- theTweenabletarget objecttype- theTweenTypedetermining which values of the target object will be modified.duration- the duration of the Tween in ticks.- Returns:
- the Tween instance
-
getTween
-
getTweens
-
reset
Looks for a registered Tween instance with the given target and type. Attempts to stop the Tween and reset theTweenablevalues to the start values.- Parameters:
target- theTweenabletarget objecttype- theTweenTypedetermining which values of the target object will be modified.- Returns:
- the Tween instance
-
resume
Looks for a registered Tween instance with the given target and type. Attempts to resume the Tween if it was stopped.- Parameters:
target- theTweenabletarget objecttype- theTweenTypedetermining which values of the target object will be modified.- Returns:
- the Tween instance
-
start
-
remove
Looks for a registered Tween instance with the given target and type. Attempts to remove the Tween from the TweenEngine.- Parameters:
target- theTweenabletarget objecttype- theTweenTypedetermining which values of the target object will be modified.
-
remove
Removes all Tweens associated with the givenTweenabletarget.- Parameters:
target- theTweenabletarget object whose Tweens are to be removed.
-
stop
Looks for a registered Tween instance with the given target and type. Attempts to stop the Tween.- Parameters:
target- theTweenabletarget objecttype- theTweenTypedetermining which values of the target object will be modified.- Returns:
- the Tween instance
-
terminate
-
update
public void update()Updates all registered Tweens by applying theTweenEquation.- Specified by:
updatein interfaceIUpdateable- See Also:
-