public interface Animation
It contains the first
and last
animation frame number, the animation speed
, a
reverse
flag (for reversed animation), and a repeat
flag (for looped animation).
first
: first frame of the animation that will be played (included).last
: last frame of the animation that will be played (included).speed
: animation speed.reverse
: reverse flag (1 -> 2 -> 3 -> 2 -> 1).repeat
: repeat flag (1 -> 2 -> 3 -> 1 -> 2 -> 3...).
Note: reverse
and repeat
can also be combined to play in loop an animation in reverse:
1 -> 2 -> 3 -> 2 -> 1 -> 2 -> 3....
Example:
final Animation animation = Anim.createAnimation(4, 6, 0.125, false, true); System.out.println(animation.getFirst()); // 4 System.out.println(animation.getLast()); // 6 System.out.println(animation.getSpeed()); // 0.125 System.out.println(animation.getReverse()); // false System.out.println(animation.getRepeat()); // true
Modifier and Type | Field and Description |
---|---|
static int |
MINIMUM_FRAME
The minimum frame number.
|
Modifier and Type | Method and Description |
---|---|
int |
getFirst()
Get the first frame of the animation.
|
int |
getLast()
Get the last frame if the animation.
|
boolean |
getRepeat()
Get the repeat state.
|
boolean |
getReverse()
Get the reverse state.
|
double |
getSpeed()
Get the animation speed.
|
static final int MINIMUM_FRAME
int getFirst()
int getLast()
double getSpeed()
boolean getReverse()
boolean getRepeat()