#Font-size increase
4 messages · Page 1 of 1 (latest)
I wrote a method for one of my mods that draws scaled texts. It would be easily adapted to scale anything. I’ll send it when I get home
public static void drawScaledText(GuiGraphics context, String text, int x, int y, float scale, int color, boolean centered) {
Matrix3x2fStack matrices = context.pose();
matrices.pushMatrix();
matrices.scale(scale, scale);
if (centered) {
context.drawCenteredString(NunYa.MC.font, text, (int) (x / scale), (int) (y / scale), color);
} else {
context.drawString(NunYa.MC.font, text, (int) (x / scale), (int) (y / scale), color);
}
matrices.popMatrix();
}
this takes a scale from 0-1. so 0.5 would be half size. you could also do 1.5 to do 150% size etc