Class BlinkEffect

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

public class BlinkEffect extends Effect
Blinks the entire text in two different colors at once, without interpolation. This can either blink between two different colors, or two different alpha levels for the default color. The alpha levels can be useful to make text disappear (alpha 0.0) and reappear (alpha 1.0) instead of changing color.
Parameters: color1;color2;frequency;threshold
The color1 can be a named color or hex color, but if it isn't valid as one of those, it will be parsed as a float and treated as an alpha transparency value instead of a color, between 0.0 and 1.0. The color2 can be a named color or hex color, but if it isn't valid as one of those, it will be parsed as a float and treated as an alpha transparency value instead of a color, between 0.0 and 1.0. The frequency is how frequently the effect should blink, defaulting to 1.0 . The threshold determines how much of the time is spent in color1; the rest is spent in color2. The default is 0.5 .
Example usage: {BLINK=RED;LIGHT BLUE}This text will blink between red and light blue.{ENDBLINK} {BLINK=1.0;0.0;5.0;0.9}This text will briefly flicker to transparent several times a second.{ENDBLINK}
  • 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