aboutsummaryrefslogtreecommitdiff
path: root/java/api/src/aurelienribon/tweenengine/TweenEquation.java
blob: d55070333691162e4414255755b22d07b4b0b3a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package aurelienribon.tweenengine;

/**
 * Base class for every easing equation. You can create your own equations
 * and directly use them in the Tween engine by inheriting from this class.
 *
 * @see Tween
 * @author Aurelien Ribon | http://www.aurelienribon.com/
 */
public abstract class TweenEquation {

	/**
	 * Computes the next value of the interpolation.
	 *
	 * @param t The current time, between 0 and 1.
	 * @return The current value.
	 */
    public abstract float compute(float t);

	/**
	 * Returns true if the given string is the name of this equation (the name
	 * is returned in the toString() method, don't forget to override it).
	 * This method is usually used to save/load a tween to/from a text file.
	 */
	public boolean isValueOf(String str) {
		return str.equals(toString());
	}
}