implement crosshair
This commit is contained in:
@@ -7,4 +7,20 @@ window.Gui = class {
|
||||
stack.globalAlpha = alpha;
|
||||
}
|
||||
|
||||
drawTexture(stack, texture, x, y, width, height, alpha = 1.0) {
|
||||
this.drawSprite(stack, texture, 0, 0, 256, 256, x, y, width, height, alpha);
|
||||
}
|
||||
|
||||
drawSprite(stack, texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height, alpha = 1.0) {
|
||||
stack.globalAlpha = alpha;
|
||||
stack.drawImage(texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height);
|
||||
stack.globalAlpha = 1.0;
|
||||
}
|
||||
|
||||
loadTexture(path) {
|
||||
let img = new Image();
|
||||
img.src = path;
|
||||
return img;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user