Class MiniMessageBridge.Animator

java.lang.Object
com.github.darksoulq.abyssallib.common.color.MiniMessageBridge.Animator
Enclosing class:
MiniMessageBridge

public static class MiniMessageBridge.Animator extends Object
A utility class for handling stateful text color animations.
  • Constructor Details

    • Animator

      public Animator(String text, ColorProvider provider, double speed)
      Parameters:
      text - The text.
      provider - The color source.
      speed - The increment speed.
  • Method Details

    • setSpeed

      public MiniMessageBridge.Animator setSpeed(double speed)
      Parameters:
      speed - The new phase increment value. @return This animator.
    • setFrequency

      public MiniMessageBridge.Animator setFrequency(double frequency)
      Parameters:
      frequency - The new spatial frequency. @return This animator.
    • setText

      public MiniMessageBridge.Animator setText(String text)
      Parameters:
      text - The new string content. @return This animator.
    • setProvider

      public MiniMessageBridge.Animator setProvider(ColorProvider provider)
      Parameters:
      provider - The new color source. @return This animator.
    • next

      public net.kyori.adventure.text.Component next()
      Advances the animation phase by speed and returns the rendered component.
      Returns:
      The next frame of the animation as a Component.
    • current

      public net.kyori.adventure.text.Component current()
      Returns the current frame of the animation without advancing the phase.
      Returns:
      The current Component.
    • reset

      public void reset()
      Resets the animation phase back to zero.