Package tripleplay.anim
Class Animator
java.lang.Object
tripleplay.anim.AnimBuilder
tripleplay.anim.Animator
Handles creation and management of animations. Animations may involve the tweening of a
geometric property of a layer (x, y, rotation, scale, alpha), or simple delays, or performing
actions. Animations can also be sequenced to orchestrate complex correlated actions.
onPaint
should be connected to a paint
signal to drive the animations.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Animation>
Tadd
(T anim) Registers an animation with this animator.void
Causes this animator to delay the start of any subsequently registered animations until all currently registered animations are complete.void
addBarrier
(float delay) Causes this animator to delay the start of any subsequently registered animations until the specified delay (in milliseconds) has elapsed after this barrier becomes active.void
clear()
Clears out any pending animations.Methods inherited from class tripleplay.anim.AnimBuilder
action, add, addAt, addAt, delay, dispose, emit, flipbook, flipbook, flipbookAt, flipbookAt, increment, play, play, reparent, repeat, setDepth, setValue, setVisible, shake, stop, stop, tween, tween, tweenAlpha, tweenOrigin, tweenRotation, tweenScale, tweenScaleX, tweenScaleXY, tweenScaleY, tweenTranslation, tweenVolume, tweenVolume, tweenX, tweenXY, tweenY
-
Field Details
-
onPaint
Performs per-frame animation processing. This should be connected to apaint
signal.
-
-
Constructor Details
-
Animator
public Animator()Creates an animator which is not connected to a frame signal. You must manually connectonPaint
to a frame signal to drive this animator. -
Animator
Creates an animator which is permanently connected topaint
. This is useful when you are connecting to a paint signal whose lifetime is the same as this animator because there's no way to ever disconnect the animator from the signal.
-
-
Method Details
-
addBarrier
public void addBarrier()Causes this animator to delay the start of any subsequently registered animations until all currently registered animations are complete. -
addBarrier
public void addBarrier(float delay) Causes this animator to delay the start of any subsequently registered animations until the specified delay (in milliseconds) has elapsed after this barrier becomes active. Any previously registered barriers must first expire and this barrier must move to the head of the list before its delay timer will be started. This is probably what you want. -
clear
public void clear()Clears out any pending animations. NOTE all animations simply disappear. Any queued animations that invoked actions will not execute, nor will the cleanup actions of any animations that involve cleanup. This should only be invoked if you know the layers involved in animations will be destroyed separately. -
add
Registers an animation with this animator. It will be started on the next frame and continue until cancelled or it reports that it has completed.- Specified by:
add
in classAnimBuilder
-