Class SlamEffect

java.lang.Object
com.github.tommyettinger.textra.Effect
com.github.tommyettinger.textra.effects.SlamEffect

public class SlamEffect extends Effect
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: 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}
  • Constructor Details

  • Method Details

    • onApply

      protected void onApply(long glyph, int localIndex, int globalIndex, float delta)
      Description copied from class: Effect
      Called when this effect should be applied to the given glyph.
      Specified by:
      onApply in class Effect