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_INBACK_INOUTBACK_OUTBOUNCE_INBOUNCE_INOUTBOUNCE_OUTCIRCLE_INCIRCLE_INOUTCIRCLE_OUTELASTIC_INELASTIC_INOUTELASTIC_OUTEXPO_INEXPO_INOUTEXPO_OUTLINEARQUAD_INQUAD_INOUTQUAD_OUTSINE_INSINE_INOUTSINE_OUTMethod Summary
Modifier and Type Method Description floatcompute(float time)Computes the next value of the interpolation.TweenEquationgetEquation()Gets the mathematical equation.static TweenFunctionvalueOf(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.
