diff options
author | sowgro <tpoke.ferrari@gmail.com> | 2023-05-16 07:08:18 -0400 |
---|---|---|
committer | sowgro <tpoke.ferrari@gmail.com> | 2023-05-16 07:08:18 -0400 |
commit | 228091f5594c4c20e6c51682e487d8325a8a3230 (patch) | |
tree | 85be9c2720f6123e83799b4d0576efc81d933aaa /src/gui/Driver.java | |
parent | 4a1f4a98116b5c59efe0606375b833a722a0d281 (diff) | |
download | NPEhero-228091f5594c4c20e6c51682e487d8325a8a3230.tar.gz NPEhero-228091f5594c4c20e6c51682e487d8325a8a3230.tar.bz2 NPEhero-228091f5594c4c20e6c51682e487d8325a8a3230.zip |
unfinnished commit
Diffstat (limited to 'src/gui/Driver.java')
-rw-r--r-- | src/gui/Driver.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/Driver.java b/src/gui/Driver.java index 77fe0b0..59002c2 100644 --- a/src/gui/Driver.java +++ b/src/gui/Driver.java @@ -17,6 +17,7 @@ import javafx.stage.Stage; public class Driver extends Application { + static Stage primaryStage; static HashMap<String,Pane> menus = new HashMap<String,Pane>(); static Pane primaryPane = new Pane(); @@ -26,8 +27,9 @@ public class Driver extends Application } @Override - public void start(Stage primaryStage) + public void start(Stage newPrimaryStage) { + primaryStage = newPrimaryStage; menus.put("MainMenu", new MainMenu()); menus.put("LevelSelector", new LevelSelector()); menus.put("Settings", new Settings()); @@ -61,6 +63,18 @@ public class Driver extends Application primaryPane.requestFocus(); } + public static void setCustomMenu(Pane pane) + { + if (! primaryPane.getChildren().isEmpty()) + { + primaryPane.getChildren().remove(0); + } + pane.minWidthProperty().bind(primaryStage.widthProperty()); + pane.minHeightProperty().bind(primaryStage.heightProperty()); + primaryPane.getChildren().add(pane); + primaryPane.requestFocus(); + } + public static void setBackground(String url) { primaryPane.setBackground(new Background( |