public class AnimationTileFlash extends java.lang.Object implements IAnimation
IAnimation.AnimationType
Modifier and Type | Field and Description |
---|---|
private IAnimationFinish |
callback |
private int |
currentPhase |
private static java.util.List<java.lang.Integer> |
flashPhase |
private float |
height |
private boolean |
keepFlashing |
private static com.badlogic.gdx.graphics.glutils.ShapeRenderer |
rect |
private boolean |
reverseAnimation |
private float |
time |
private static float |
timeout |
private float |
width |
private float |
x |
private float |
y |
Constructor and Description |
---|
AnimationTileFlash(float x,
float y,
float width,
float height) |
Modifier and Type | Method and Description |
---|---|
private float |
calculateOpacity()
Calculate opacity for rectangle.
|
void |
callAnimationFinish() |
void |
cancelAnimation() |
IAnimation.AnimationType |
getType() |
void |
setAnimationFinish(IAnimationFinish callback)
Set the animation finish callback.
|
boolean |
tick(float delta,
AbstractAnimationScreen screen,
com.badlogic.gdx.graphics.g2d.Batch batch)
Draw animation on screen.
|
private void |
updateRectOpacity()
Updates rectangle opacity.
|
private static final com.badlogic.gdx.graphics.glutils.ShapeRenderer rect
private final float height
private final float x
private final float y
private final float width
private final int currentPhase
private float time
private static final float timeout
private IAnimationFinish callback
private boolean keepFlashing
private boolean reverseAnimation
private static final java.util.List<java.lang.Integer> flashPhase
public AnimationTileFlash(float x, float y, float width, float height)
public boolean tick(float delta, AbstractAnimationScreen screen, com.badlogic.gdx.graphics.g2d.Batch batch)
IAnimation
tick
in interface IAnimation
delta
- Time change since last call.screen
- The screen to draw on.batch
- The Batch for drawing stuff.true
if the animation has completed.private void updateRectOpacity()
private float calculateOpacity()
public void setAnimationFinish(IAnimationFinish callback)
IAnimation
setAnimationFinish
in interface IAnimation
callback
- The callback function.public void callAnimationFinish()
callAnimationFinish
in interface IAnimation
public void cancelAnimation()
cancelAnimation
in interface IAnimation
public IAnimation.AnimationType getType()
getType
in interface IAnimation