public abstract class Effect
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
float |
duration |
int |
indexEnd |
int |
indexStart |
protected TypingLabel |
label |
protected float |
totalTime |
| Constructor and Description |
|---|
Effect(TypingLabel label) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(long glyph,
int glyphIndex,
float delta)
Applies the effect to the given glyph.
|
protected float |
calculateFadeout()
Calculates the fadeout of this effect, if any.
|
protected float |
calculateProgress(float modifier)
Calculates a linear progress dividing the total time by the given modifier.
|
protected float |
calculateProgress(float modifier,
float offset)
Calculates a linear progress dividing the total time by the given modifier.
|
protected float |
calculateProgress(float modifier,
float offset,
boolean pingpong)
Calculates a linear progress dividing the total time by the given modifier.
|
boolean |
isFinished()
Returns whether or not this effect is finished and should be removed.
|
protected abstract void |
onApply(long glyph,
int localIndex,
int globalIndex,
float delta)
Called when this effect should be applied to the given glyph.
|
protected boolean |
paramAsBoolean(java.lang.String str)
Returns a boolean value parsed from the given String, or the default value if the string couldn't be parsed.
|
protected int |
paramAsColor(java.lang.String str)
Parses a color from the given string.
|
protected float |
paramAsFloat(java.lang.String str,
float defaultValue)
Returns a float value parsed from the given String, or the default value if the string couldn't be parsed.
|
void |
update(float delta) |
protected final TypingLabel label
public int indexStart
public int indexEnd
public float duration
protected float totalTime
public Effect(TypingLabel label)
public void update(float delta)
public final void apply(long glyph,
int glyphIndex,
float delta)
protected abstract void onApply(long glyph,
int localIndex,
int globalIndex,
float delta)
public boolean isFinished()
protected float calculateFadeout()
protected float calculateProgress(float modifier)
protected float calculateProgress(float modifier,
float offset)
protected float calculateProgress(float modifier,
float offset,
boolean pingpong)
protected float paramAsFloat(java.lang.String str,
float defaultValue)
protected boolean paramAsBoolean(java.lang.String str)
protected int paramAsColor(java.lang.String str)