Enum TweenFunction
java.lang.Object
java.lang.Enum<TweenFunction>
de.gurkenlabs.litiengine.tweening.TweenFunction
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<TweenFunction>
,java.lang.constant.Constable
public enum TweenFunction
extends java.lang.Enum<TweenFunction>
Easing equations based on Robert Penner's work: http://robertpenner.com/easing/
Nested Class Summary
Enum Constant Summary
Enum Constants Enum Constant Description BACK_IN
BACK_INOUT
BACK_OUT
BOUNCE_IN
BOUNCE_INOUT
BOUNCE_OUT
CIRCLE_IN
CIRCLE_INOUT
CIRCLE_OUT
ELASTIC_IN
ELASTIC_INOUT
ELASTIC_OUT
EXPO_IN
EXPO_INOUT
EXPO_OUT
LINEAR
QUAD_IN
QUAD_INOUT
QUAD_OUT
SINE_IN
SINE_INOUT
SINE_OUT
Method Summary
Modifier and Type Method Description float
compute(float time)
Computes the next value of the interpolation.TweenEquation
getEquation()
Gets the mathematical equation.static TweenFunction
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TweenFunction[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Details
Method Details
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
getEquation
Gets the mathematical equation.- Returns:
- the equation
compute
public float compute(float time)Computes the next value of the interpolation.- Parameters:
time
- The current progress of the tween duration, between 0 and 1.- Returns:
- The next interpolated value.