public class Animation
extends java.lang.Object
| Constructor and Description |
|---|
Animation() |
Animation(AnimationMode mode) |
| Modifier and Type | Method and Description |
|---|---|
Animation |
finish()
Finish the animation immediately.
|
Animation |
frame(java.util.function.Consumer<AnimationFrameBuilder> frameBuilder)
Add a new frame to the animation.
|
Animation |
frame(EasingFunction easingFunction,
EasingMode easingMode,
float[] startValue,
float[] endValue,
java.lang.Integer duration,
EasingBehavior easingBehavior)
Add a new frame to the animation.
|
Animation |
frame(EasingFunction easingFunction,
EasingMode easingMode,
float startValue,
float endValue,
java.lang.Integer duration,
EasingBehavior easingBehavior)
Add a new frame to the animation.
|
int |
getCurrentFrame() |
AnimationDirection |
getDirection() |
float[] |
getEnd(int frame)
Get the end value of the given frame.
|
int |
getFrameCount() |
float[] |
getStart(int frame)
Get the start value of the given frame.
|
float |
getValue() |
float[] |
getValues() |
boolean |
isFinished() |
boolean |
isRunning() |
Animation |
reset()
Reset the animation to the start.
|
Animation |
reverse()
Reverse the current animation direction.
|
Animation |
setDirection(AnimationDirection direction)
Set the direction of the animation.
|
Animation |
setFrameByFrame(boolean frameByFrame)
Set if the animation should be played frame by frame or not.
|
Animation |
setMode(AnimationMode mode)
Set the mode of the animation.
|
Animation |
start()
Start the animation.
|
Animation |
start(AnimationDirection direction)
Start the animation in the given direction.
|
Animation |
stop()
Stop the animation.
|
public Animation()
public Animation(AnimationMode mode)
public Animation frame(java.util.function.Consumer<AnimationFrameBuilder> frameBuilder)
frameBuilder - The builder for the framepublic Animation frame(@Nullable EasingFunction easingFunction, @Nullable EasingMode easingMode, float startValue, float endValue, @Nullable java.lang.Integer duration, @Nullable EasingBehavior easingBehavior)
null will be copied from the last frame.easingFunction - The easing function for the frameeasingMode - The easing mode for the framestartValue - The start value for the frameendValue - The end value for the frameduration - The duration for the frameeasingBehavior - The reverse behavior for the framepublic Animation frame(@Nullable EasingFunction easingFunction, @Nullable EasingMode easingMode, @Nullable float[] startValue, @Nullable float[] endValue, @Nullable java.lang.Integer duration, @Nullable EasingBehavior easingBehavior)
null will be copied from the last frame.easingFunction - The easing function for the frameeasingMode - The easing mode for the framestartValue - The start value for the frameendValue - The end value for the frameduration - The duration for the frameeasingBehavior - The reverse behavior for the framepublic Animation setMode(AnimationMode mode)
mode - The mode of the animationpublic Animation setFrameByFrame(boolean frameByFrame)
true, manually calling the start() method is required to continue the animation.frameByFrame - If the animation should be played frame by framepublic boolean isRunning()
public boolean isFinished()
public AnimationDirection getDirection()
public Animation setDirection(AnimationDirection direction)
direction - The direction of the animationpublic int getCurrentFrame()
public int getFrameCount()
public float[] getStart(int frame)
frame - The frame to get the start value frompublic float[] getEnd(int frame)
frame - The frame to get the end value frompublic Animation reverse()
public Animation start(AnimationDirection direction)
direction - The direction to start the animation inpublic Animation start()
public Animation stop()
getValues().public Animation reset()
public Animation finish()
public float getValue()
public float[] getValues()