public class TypingTextAnimation extends BaseTextAnimation
TextAnimation
that reveals the text as if it were being typedConstructor and Description |
---|
TypingTextAnimation()
Constructor.
|
TypingTextAnimation(float charactersPerSecond)
Constructor
|
Modifier and Type | Method and Description |
---|---|
float |
getCharactersPerSecond() |
void |
interpolate(java.lang.String text,
float alpha)
Interpolate the animation
|
void |
render(java.lang.String text,
Graphics g,
float x,
float y,
float width,
int hAlign)
Renders the animation
|
void |
skip()
Sets the
TextAnimation to be skipped |
void |
update(java.lang.String text,
float delta)
Update the animation
|
addTextAnimationListener, isFinished, removeTextAnimationListener, setFinished
public TypingTextAnimation()
public TypingTextAnimation(float charactersPerSecond)
charactersPerSecond
- The amount of characters to reveal per secondpublic void update(java.lang.String text, float delta)
TextAnimation
text
- The target text to displaydelta
- The time since the last frame (in seconds)public void interpolate(java.lang.String text, float alpha)
TextAnimation
text
- The target text to displayalpha
- The interpolation alpha valuepublic void render(java.lang.String text, Graphics g, float x, float y, float width, int hAlign)
TextAnimation
text
- The target text to displayg
- The Graphics
contextx
- The render X coordinatey
- The render Y coordinatewidth
- The text render widthhAlign
- The horizontal alignment of the textpublic void skip()
TextAnimation
TextAnimation
to be skippedpublic float getCharactersPerSecond()