Compare commits

...

2 Commits

Author SHA1 Message Date
Mal
2c9e14f777 Fix for canvas background bug in Chromium 2025-11-01 14:34:46 +01:00
Mal
f3ac21839d Tilorswift prevents unintentional window closings 2025-05-24 13:06:36 +02:00
3 changed files with 9 additions and 2 deletions

View File

@@ -214,7 +214,7 @@ export class Game
this.canvas.style.backgroundImage = 'none';
}
this.canvas.style.backgroundColor = this.level.getBackgroundColor();
document.body.style.backgroundColor = this.level.getBackgroundColor();
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;

View File

@@ -6,6 +6,13 @@ import Setting from "../../js/Setting.js";
const imageLoader = new ImageLoader();
window.addEventListener(
'beforeunload',
(event) => {
event.preventDefault();
}
);
for (const graphicSet of GraphicSet) {
imageLoader.addImage('../' + Setting.TILESET_LOCATION + graphicSet.tileset);