aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/hud/TextHud.java
blob: 9525ba43331b1904321c4fd77b0cce12fbd309ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package cc.polyfrost.oneconfig.hud;

import cc.polyfrost.oneconfig.lwjgl.RenderManager;
import gg.essential.universal.UMinecraft;

public abstract class TextHud extends BasicHud {
    public TextHud(boolean enabled, int x, int y) {
        super(enabled, x, y);
    }

    @Override
    public int getWidth(float scale) {
        return (int) (UMinecraft.getFontRenderer().getStringWidth(getText()) * scale);
    }

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

    @Override
    public void draw(int x, int y, float scale) {
        RenderManager.drawScaledString(getText(), x, y, 0xffffff, false, scale);
    }

    public abstract String getText();
}