Class ShakeEffect

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

public class ShakeEffect extends Effect
Shakes the text in a random pattern.
Parameters: distance;speed;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 duration is how many seconds the shaking should go on, or _ to repeat forever; defaults to positive infinity.
Example usage: {SHAKE=0.5;0.8;_}Each glyph here will shake a little and with slower movement; the shaking will go on forever.{ENDSHAKE} {SHAKE=2.5;1.0;5}Each glyph here will shake a lot, at normal speed, for 5 seconds total.{ENDSHAKE}
  • 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