Class MiniMessageBridge.Animator
java.lang.Object
com.github.darksoulq.abyssallib.common.color.MiniMessageBridge.Animator
- Enclosing class:
MiniMessageBridge
A utility class for handling stateful text color animations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.Componentcurrent()Returns the current frame of the animation without advancing the phase.net.kyori.adventure.text.Componentnext()Advances the animation phase byspeedand returns the rendered component.voidreset()Resets the animation phase back to zero.setFrequency(double frequency) setProvider(ColorProvider provider) setSpeed(double speed)
-
Constructor Details
-
Animator
- Parameters:
text- The text.provider- The color source.speed- The increment speed.
-
-
Method Details
-
setSpeed
- Parameters:
speed- The new phase increment value. @return This animator.
-
setFrequency
- Parameters:
frequency- The new spatial frequency. @return This animator.
-
setText
- Parameters:
text- The new string content. @return This animator.
-
setProvider
- Parameters:
provider- The new color source. @return This animator.
-
next
public net.kyori.adventure.text.Component next()Advances the animation phase byspeedand 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.
-