Class CannonEffect

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

public class CannonEffect extends Effect
Starts the text large and shrinks into the final position/size, arcing up and then ending moving down; may optionally shake once it arrives at its destination. Doesn't repeat itself.
Parameters: initialStretch;extent;height;shakeDuration;shakePower
The initialStretch affects how big the glyphs should be while they are in the "foreground;" defaults to 1.0 . The extent extends how long it takes for the glyphs to enter their target positions; defaults to 1.0 . The height is how many line-heights the glyphs should arc up and then down; defaults to 1.0 . The shakeDuration is how many seconds the glyph should shake after it "hits" its target; defaults to 2.0 . The shakePower affects how much each glyph should shake after it "hits" its target; defaults to 1.0 .
Example usage: {CANNON=0.5;1.5;0.25;0.3;0.2}This text will start smaller, travel faster, arc less, and not shake much.{ENDCANNON} {CANNON=2.5;0.75;1.5;1.7;2.1}This text will start larger, travel more slowly, arc more, shake longer, and shake much more.{ENDCANNON}
  • 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