aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/component/Component.java
blob: 3c9870689f9fe8c7d94cbfd09b5753aadde0f1ba (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
28
29
30
31
package de.hysky.skyblocker.skyblock.tabhud.widget.component;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;

/**
 * Abstract base class for a component that may be added to a Widget.
 */
public abstract class Component {

    static final int ICO_DIM = 16;
    public static final int PAD_S = 2;
    public static final int PAD_L = 4;

    static final TextRenderer txtRend = MinecraftClient.getInstance().textRenderer;

    // these should always be the content dimensions without any padding.
    int width, height;

    public abstract void render(DrawContext context, int x, int y);

    public int getWidth() {
        return this.width;
    }

    public int getHeight() {
        return this.height;
    }

}