aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Driver.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/gui/Driver.java16
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(