aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/test/TestHud.java
blob: 67f0610277a4c219cbf2a6bde89f40b5b8cea0b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package io.polyfrost.oneconfig.test;

import io.polyfrost.oneconfig.hud.interfaces.BasicHud;
import io.polyfrost.oneconfig.renderer.Renderer;
import net.minecraft.client.Minecraft;

public class TestHud extends BasicHud {

    @Override
    public int getWidth(float scale) {
        return (int) (Minecraft.getMinecraft().fontRendererObj.getStringWidth("FPS: " + Minecraft.getDebugFPS()) * scale);
    }

    @Override
    public int getHeight(float scale) {
        return (int) (9 * scale);
    }

    @Override
    public void draw(int x, int y, float scale) {
        Renderer.drawScaledString("FPS: " + Minecraft.getDebugFPS(), x, y, 0xffffff, false, scale);
    }
}