diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-05-14 01:46:56 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-05-14 01:46:56 -0400 |
commit | 9568ea5118b9100b3375a6bd2153042506b0d5d1 (patch) | |
tree | 0e8ea5d267677bfc914b52ced330022ecd7efce9 /src/gui/Driver.java | |
parent | 054ff93a8e5bf51988f0324619ae4c95249f9556 (diff) | |
download | NPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.tar.gz NPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.tar.bz2 NPEhero-9568ea5118b9100b3375a6bd2153042506b0d5d1.zip |
Finish css and menus
Diffstat (limited to 'src/gui/Driver.java')
-rw-r--r-- | src/gui/Driver.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/Driver.java b/src/gui/Driver.java index f9449cd..77fe0b0 100644 --- a/src/gui/Driver.java +++ b/src/gui/Driver.java @@ -38,25 +38,27 @@ public class Driver extends Application value.minHeightProperty().bind(primaryStage.heightProperty()); } - primaryPane.getChildren().add(menus.get("MainMenu")); - primaryPane.minWidthProperty().bind(primaryStage.widthProperty()); - primaryPane.minHeightProperty().bind(primaryStage.heightProperty()); - setBackground("assets/water.png"); - Scene primaryScene = new Scene(primaryPane, 800, 600); primaryScene.getStylesheets().add("gui/style.css"); primaryStage.setScene(primaryScene); primaryStage.setTitle("NPE Hero"); + + setMenu("MainMenu"); + setBackground("assets/water.png"); + primaryStage.show(); - primaryStage.setFullScreen(true); } - public static void switchMenu(String name) + public static void setMenu(String name) { - primaryPane.getChildren().remove(0); + if (! primaryPane.getChildren().isEmpty()) + { + primaryPane.getChildren().remove(0); + } primaryPane.getChildren().add(menus.get(name)); + primaryPane.requestFocus(); } public static void setBackground(String url) |