improve texture loading

This commit is contained in:
LabyStudio
2022-02-12 22:17:15 +01:00
parent d77a7dae0c
commit bb2d830c84
3 changed files with 105 additions and 75 deletions
+2 -6
View File
@@ -110,11 +110,7 @@ window.Gui = class {
stack.restore();
}
static loadTexture(path, callback) {
let img = new Image();
img.src = "src/resources/" + path;
img.onload = callback;
return img;
static loadTexture(path) {
return document.textures[path];
}
}