fullscreenButton
This commit is contained in:
12
app.js
12
app.js
@@ -144,6 +144,18 @@ let game = {
|
|||||||
menu.startButton.name("Rejouer")
|
menu.startButton.name("Rejouer")
|
||||||
menu.startButton.show()
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ span {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.lil-gui.autoPlace {
|
.lil-gui.autoPlace {
|
||||||
top: inherit;
|
top: auto;
|
||||||
bottom: 15px;
|
bottom: 15px;
|
||||||
left: 15px;
|
left: 15px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export class Menu extends GUI {
|
|||||||
scene.tetrisSound.setVolume(volume/100)
|
scene.tetrisSound.setVolume(volume/100)
|
||||||
scene.hardDropSound.setVolume(volume/100)
|
scene.hardDropSound.setVolume(volume/100)
|
||||||
})
|
})
|
||||||
|
this.settings.fullscreenButton = this.settings.add(game, "fullscreen").name("Plein écran")
|
||||||
|
|
||||||
let material
|
let material
|
||||||
function changeMaterial() {
|
function changeMaterial() {
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class TetraScene extends THREE.Scene {
|
|||||||
case "Espace":
|
case "Espace":
|
||||||
this.ambientLight.intensity = 7
|
this.ambientLight.intensity = 7
|
||||||
this.directionalLight.intensity = 5
|
this.directionalLight.intensity = 5
|
||||||
this.directionalLight.position.set(2, -10, 20)
|
this.directionalLight.position.set(2, -3, 20)
|
||||||
this.music.src = "audio/benevolence.m4a"
|
this.music.src = "audio/benevolence.m4a"
|
||||||
break
|
break
|
||||||
case "Rétro":
|
case "Rétro":
|
||||||
|
|||||||
Reference in New Issue
Block a user