fullscreenButton

This commit is contained in:
2026-01-25 15:18:36 +01:00
parent a3b0713b7a
commit 1f2a5d830c
4 changed files with 16 additions and 3 deletions

12
app.js
View File

@@ -144,6 +144,18 @@ let game = {
menu.startButton.name("Rejouer")
menu.startButton.show()
},
fullscreen: function() {
if (!document.fullscreenElement) {
document.body.requestFullscreen();
menu.settings.fullscreenButton.name("Quitter le plein écran");
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
menu.settings.fullscreenButton.name("Plein écran");
}
}
}
}