aboutsummaryrefslogtreecommitdiff
path: root/src/gui/Driver.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-05-14 01:46:56 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-05-14 01:46:56 -0400
commit9568ea5118b9100b3375a6bd2153042506b0d5d1 (patch)
tree0e8ea5d267677bfc914b52ced330022ecd7efce9 /src/gui/Driver.java
parent054ff93a8e5bf51988f0324619ae4c95249f9556 (diff)
downloadNPEhero-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.java18
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)