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