Hello, does anyone know how to draw a string with two colors in the same sentence? Since currently I am trying to make a custom main menu and it does not put the colors together. Code:
I believe the -1 part does something to cause this.
This is the result of this:
Java:
String firstPart = Color.PINK + "R";
String secondPart = Color.WHITE + "aze";
String combinedString = firstPart + secondPart;
int stringWidth = mc.fontRendererObj.getStringWidth(combinedString);
int centerX = Math.round(width / 2f);
int centerY = Math.round(height / 2f - mc.fontRendererObj.FONT_HEIGHT / 2f);
mc.fontRendererObj.drawString(combinedString, centerX - stringWidth / 2, centerY, -1);
I believe the -1 part does something to cause this.
This is the result of this:
