Class SlamEffect
java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.SlamEffect
Starts the text with a y-offset, holds there for a short time, drops quickly into the final position/size, and may
optionally shake after dropping in. Doesn't repeat itself.
Parameters:
The
Example usage:
Parameters:
initialStretch;extent;height;shakeDuration;shakePower
The
hangTime
is how many seconds the glyph should stay elevated before dropping; defaults to 0.25 .
The extent
affects how long the animation should be extended by (not in any unit); defaults to 1.0 .
The height
is how many line-heights the glyphs should start above the destination; defaults to 1.0 .
The shakeDuration
is how many seconds the glyph should shake after it reaches its target; defaults to 2.0 .
The shakePower
affects how much each glyph should shake after it reaches its target; defaults to 1.0 .
Example usage:
{SLAM=0.5;2.0;2.5;1.5;2.0}This text will hang briefly, travel faster, start higher, and shake longer, and shake a lot.{ENDSLAM}
{SLAM=2.5;0.75;-0.5;0.7;0.9}This text will hang longer, travel more slowly, start a little below the destination, shake less time, and shake less.{ENDSLAM}
-
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