Class HideEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.HideEffect
Fades the text's color from between colors or alphas when clicked. Doesn't repeat itself.
To show the text can be clicked, it is differentiated by the fancy underline
Parameters:
The
Example usage:
Animated preview here. This doesn't show anything other than the "note" underline because it needs mouse/touch interaction.
Font.NOTE, which
defaults to a blue wavy underline. Its color can be customized by changing Font.PACKED_NOTE_COLOR.
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.
With no parameters, this only shows a blue wavy underline underneath invisible text, until that text is clicked.
Then, the invisible text fades into view over one second.
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:
{HIDE=RED;LIGHT BLUE;2.0}This text will fade from red to light blue over 2 seconds.{ENDHIDE}
{HIDE=0.0;1.0;0.5}This text will go from invisible to the default color in half a second.{ENDHIDE}
Animated preview here. This doesn't show anything other than the "note" underline because it needs mouse/touch interaction.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.github.tommyettinger.textra.Effect
Effect.EffectBuilder -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonApply(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