diff --git a/app/src/main/java/school_project/Controller.java b/app/src/main/java/school_project/Controller.java index 0f827ab..3e3aacf 100644 --- a/app/src/main/java/school_project/Controller.java +++ b/app/src/main/java/school_project/Controller.java @@ -32,9 +32,6 @@ public class Controller extends Application { stage.setTitle("ROAD TO MASTER YOU"); // Full Screen mode - stage.setFullScreen(true); - stage.setFullScreenExitHint(""); - primaryStage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH); root = new MenuAccueil(); @@ -44,6 +41,8 @@ public class Controller extends Application { public static void switchRoot(Parent root){ + + Scene scene = new Scene(root); if(root instanceof GameUI){ scene.setOnKeyPressed(event ->{ @@ -59,6 +58,10 @@ public class Controller extends Application { }); } stage.setScene(scene); + + stage.setFullScreen(true); + stage.setFullScreenExitHint(""); + stage.setFullScreenExitKeyCombination(KeyCombination.NO_MATCH); } public static void main(String[] args) { launch();