Class PinchEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.PinchEffect
Randomly selects and squeezes individual characters in the text, reducing their width and increasing their height.
Parameters:
The
Example usage:
Parameters:
strength;duration;likelihood;elastic
The
strength affects how much a selected glyph should be scaled in and up, as a fraction between 0 and 1; defaults to 0.5 .
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 squeezed; defaults to 0.1 .
If elastic is true, the glyphs will wiggle to their squashed and then full size; defaults to false, which uses linear movement.
Example usage:
{PINCH=0.8;_;0.25;f}This text will select glyphs to squeeze much more frequently, and squeeze them more than usual;
it won't be elastic. The effect won't ever end.{ENDPINCH}
{PINCH=0.3;5;0.03;t}This text will select glyphs to squeeze infrequently, and squeeze less than usual; it will be
elastic at the end of each pinch. The effect will end after 5 seconds.{ENDPINCH}
-
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