implement font renderer and gui scaling

This commit is contained in:
LabyStudio
2022-02-04 10:56:24 +01:00
parent 7a5c307afd
commit 0cf779936e
14 changed files with 201 additions and 58 deletions
@@ -1,18 +1,21 @@
window.IngameOverlay = class extends Gui {
constructor(window) {
constructor(minecraft, window) {
super();
this.minecraft = minecraft;
this.window = window;
this.textureCrosshair = Gui.loadTexture("icons.png");
}
render(stack, mouseX, mouseY, partialTicks) {
this.renderCrosshair(stack, this.window.width / 2, this.window.height / 2)
if (this.minecraft.hasInGameFocus()) {
this.renderCrosshair(stack, this.window.width / 2, this.window.height / 2)
}
}
renderCrosshair(stack, x, y) {
let size = 15 * 4;
let size = 15;
this.drawSprite(stack, this.textureCrosshair, 0, 0, 15, 15, x - size / 2, y - size / 2, size, size, 0.6);
}