Class ThrobEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.ThrobEffect
Vibrates the text in a random pattern, with the effect strengthening and weakening at a regular interval.
This might be useful to indicate a ringing phone or a headache.
Parameters:
The
Example usage:
This might be useful to indicate a ringing phone or a headache.
Parameters:
distance;speed;frequency;duration
The
distance is how many line-heights each glyph should move at most in any direction; defaults to 1.0 .
The speed is how quickly each glyph should move; defaults to 1.0 .
The frequency is how quickly the strength should change; defaults to 1.0.
The duration is how many seconds the shaking should go on, or _ to repeat forever; defaults to
positive infinity.
Example usage:
{THROB=0.5;0.8;0.5;_}Each glyph here will shake a little, with slower movement, and will change strength slowly; the shaking will go on forever.{ENDTHROB}
{THROB=2.5;1.0;3.0;5}Each glyph here will shake a lot, at normal speed, with rapidly changing strength, for 5 seconds total.{ENDTHROB}
-
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