onfullscreenchange
This commit is contained in:
15
app.js
15
app.js
@@ -145,18 +145,23 @@ let game = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
fullscreen: function() {
|
fullscreen: function() {
|
||||||
if (!document.fullscreenElement) {
|
if (document.fullscreenElement) {
|
||||||
document.body.requestFullscreen();
|
|
||||||
menu.settings.fullscreenButton.name("Quitter le plein écran");
|
|
||||||
} else {
|
|
||||||
if (document.exitFullscreen) {
|
if (document.exitFullscreen) {
|
||||||
document.exitFullscreen();
|
document.exitFullscreen();
|
||||||
menu.settings.fullscreenButton.name("Plein écran");
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
document.body.requestFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.onfullscreenchange = function() {
|
||||||
|
if (document.fullscreenElement) {
|
||||||
|
menu.settings.fullscreenButton.name("Quitter le plein écran");
|
||||||
|
} else {
|
||||||
|
menu.settings.fullscreenButton.name("Plein écran");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function playSound(sound, note=0) {
|
function playSound(sound, note=0) {
|
||||||
sound.stop()
|
sound.stop()
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ export class Menu extends GUI {
|
|||||||
|
|
||||||
let vortex = dev.addFolder("vortex opacity").close()
|
let vortex = dev.addFolder("vortex opacity").close()
|
||||||
vortex.add(scene.vortex.transparentCylinder.material, "opacity").name("dark").min(0).max(1).listen()
|
vortex.add(scene.vortex.transparentCylinder.material, "opacity").name("dark").min(0).max(1).listen()
|
||||||
vortex.add(scene.vortex.opaqueCylinder.material, "opacity").name("opaque").min(0).max(1).listen()
|
|
||||||
|
|
||||||
changeMaterial(scene.minoes.material.constructor.name)
|
changeMaterial(scene.minoes.material.constructor.name)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user