#Font-size increase

4 messages · Page 1 of 1 (latest)

vivid arch
#

Hey, its propably easy fix, but I cannot manage to find an answer. I want to increase the size of this Hud Element. How can I do that?
I have tried using matrices.scale(2), but it only increases my minecraft window size by 2.

velvet trellis
#

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

velvet trellis
#
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