Class FadeEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.FadeEffect
Fades the text's color from between colors or alphas. Doesn't repeat itself.
This can either fade between two different colors, or two different alpha levels for the default color. The alpha
levels can be useful to make text go from invisible (alpha 0.0) to visible (alpha 1.0) instead of changing color.
Parameters:
The
Example usage:
Parameters:
color1;color2;duration
The
color1
can be a named color or hex color, but if it isn't valid as one of those, it will be parsed as a
float and treated as an alpha transparency value instead of a color, between 0.0 and 1.0.
The color2
can be a named color or hex color, but if it isn't valid as one of those, it will be parsed as a
float and treated as an alpha transparency value instead of a color, between 0.0 and 1.0.
The duration
is how many seconds the fade should take to go from color1 to color2; defaults to 1.0 .
Example usage:
{FADE=RED;LIGHT BLUE;2.0}This text will fade from red to light blue over 2 seconds.{ENDFADE}
{FADE=0.0;1.0;0.5}This text will go from invisible to the default color in half a second.{ENDFADE}
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.textra.Effect
Effect.EffectBuilder
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
onApply
(long glyph, int localIndex, int globalIndex, float delta) Called when this effect should be applied to the given glyph.Methods inherited from class com.github.tommyettinger.textra.Effect
apply, assignTokenName, calculateFadeout, calculateProgress, calculateProgress, calculateProgress, isFinished, paramAsBoolean, paramAsColor, paramAsFloat, update