Class JoltEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.JoltEffect
Randomly selects and shakes individual characters in the text, changing their color while shaking.
Parameters:
The
Example usage:
Parameters:
shakeDistance;shakeSpeed;duration;likelihood;baseColor;joltColor
The
shakeDistance
affects how far a shaking glyph should move from its original position; defaults to 1.0 .
The shakeSpeed
affects how fast a shaking glyph should move; defaults to 1.0 .
The duration
affects how long the effect will continue for, in seconds; defaults to positive infinity.
The likelihood
affects how often a glyph is selected to be shaken; defaults to 0.05 .
The baseColor
can be a named color or hex color, but if not a color this will only shake glyphs, not color them
while shaking. Defaults to _
(not a color).
The joltColor
can be a named color or hex color, and will be used as the color for shaking glyphs as long as
baseColor
has an actual color value (not _
). Defaults to #FFFF88FF
(light yellow).
Example usage:
{JOLT=1;0.8;_;0.25;dddddd;fff0cc}This text will shake more slowly, and select glyphs to shake much more frequently;
it will start light gray and become pale yellow when shaking. The effect won't ever end.{ENDJOLT}
{JOLT=1;1;_;0.05;DARKEST RED;RED}This text will default to very dark red but will make individual characters pop out
in shaking bright red text. The effect won't ever end.{ENDJOLT}
-
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