round decimal gui rendering

This commit is contained in:
LabyStudio
2022-05-03 22:41:08 +02:00
parent 898d0b0a84
commit ed0849ca28
2 changed files with 12 additions and 2 deletions
+11 -1
View File
@@ -118,7 +118,17 @@ export default class Gui {
static drawSprite(stack, texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height, alpha = 1.0) {
stack.save();
stack.globalAlpha = alpha;
stack.drawImage(texture, spriteX, spriteY, spriteWidth, spriteHeight, x, y, width, height);
stack.drawImage(
texture,
Math.floor(spriteX),
Math.floor(spriteY),
Math.floor(spriteWidth),
Math.floor(spriteHeight),
Math.floor(x),
Math.floor(y),
Math.floor(width),
Math.floor(height)
);
stack.restore();
}
}