Class BlinkEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.BlinkEffect
Blinks the entire text in two different colors at once, without interpolation.
This can either blink between two different colors, or two different alpha levels for the default color. The alpha
levels can be useful to make text disappear (alpha 0.0) and reappear (alpha 1.0) instead of changing color.
Parameters:
The
Example usage:
Parameters:
color1;color2;frequency;threshold
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 frequency
is how frequently the effect should blink, defaulting to 1.0 .
The threshold
determines how much of the time is spent in color1; the rest is spent in color2. The default
is 0.5 .
Example usage:
{BLINK=RED;LIGHT BLUE}This text will blink between red and light blue.{ENDBLINK}
{BLINK=1.0;0.0;5.0;0.9}This text will briefly flicker to transparent several times a second.{ENDBLINK}
-
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