implement crosshair
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user