Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Source Rainbow/Chroma Text

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:
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);
        }
    }
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.
 
Klingt nach ner richtig performanten idee jedes mal nen FontRenderer zu initialisieren.. =)
 
Benutze die Methode zwei mal in meinem client, die 30mb ram machen jz nicht den unterschied...
ehm, wenn du damit nur einen einzigen string rendern solltest, was ich echt nicht glaube, wird das teil mindestens 60 mal pro sek initialisiert :D
aber sind deine verlorenen fps nicht meine :^)
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top