Class PinchEffect

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

public class PinchEffect extends Effect
Randomly selects and squeezes individual characters in the text, reducing their width and increasing their height.
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}
  • 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