SooStrator187
New member
- Joined
- Apr 24, 2021
- Messages
- 7
- Reaction score
- 3
- Points
- 0
Since I couldn't find anything about it in the forum, I did it myself:
At the moment it is with my FontRenderer but it shouldn't be a problem to change it to yours or even the default Minecraft FontRenderer.
If you have problems just Pm me.
Code:
public static void drawChromaString(String text, int x, int y, boolean shadow, int size) {
FontRenderer fr = new FontRenderer("Arial", size);
int tmpX = x;
for (char currentChar : text.toCharArray()) {
long l = System.currentTimeMillis() - (tmpX * 10 - y * 10);
int currentColor = Color.HSBtoRGB(l % (int) 2000.0F / 2000.0F, 0.8F, 0.8F);
String tmp = String.valueOf(currentChar);
fr.drawString(text, tmpX, y, currentColor, shadow);
tmpX += fr.getCharWidth(currentChar);
}
}
If you have problems just Pm me.