implement crosshair

This commit is contained in:
LabyStudio
2022-02-03 13:06:04 +01:00
parent 88db6b5e80
commit 356eab2b0c
5 changed files with 35 additions and 2 deletions
@@ -1,7 +1,19 @@
window.IngameOverlay = class extends Gui {
constructor(window) {
super();
this.window = window;
this.textureCrosshair = this.loadTexture("icons.png");
}
render(stack, mouseX, mouseY, partialTicks) {
this.drawRect(stack, 0, 0, 500, 500, '#0000FF');
this.renderCrosshair(stack, this.window.width / 2, this.window.height / 2)
}
renderCrosshair(stack, x, y) {
let size = 15 * 4;
this.drawSprite(stack, this.textureCrosshair, 0, 0, 15, 15, x - size / 2, y - size / 2, size, size, 0.6);
}
}