aboutsummaryrefslogtreecommitdiff
path: root/src/gui/MainMenu.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2024-07-08 02:41:31 -0400
committersowgro <tpoke.ferrari@gmail.com>2024-07-08 02:41:31 -0400
commitee2229339429d50afa33e2f8b9c0ee0939766290 (patch)
treea5ee54bd23c24950e9b10815f3e87605906992d8 /src/gui/MainMenu.java
parent9e1371424bdf4c31d756d686313730d4c61f7ac5 (diff)
downloadNPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.tar.gz
NPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.tar.bz2
NPEhero-ee2229339429d50afa33e2f8b9c0ee0939766290.zip
Change project structure, embed resources into jar and remove libraries from source control
Diffstat (limited to 'src/gui/MainMenu.java')
-rw-r--r--src/gui/MainMenu.java68
1 files changed, 0 insertions, 68 deletions
diff --git a/src/gui/MainMenu.java b/src/gui/MainMenu.java
deleted file mode 100644
index 84a7508..0000000
--- a/src/gui/MainMenu.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package gui;
-
-import javafx.geometry.Pos;
-import javafx.scene.control.Button;
-import javafx.scene.effect.BlurType;
-import javafx.scene.effect.DropShadow;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import javafx.scene.paint.Color;
-import javafx.scene.text.Text;
-
-
-public class MainMenu extends Pane
-{
- /*
- * this class is a layout class, most of its purpose is to place UI elements like Buttons within Panes like VBoxes.
- * the creation of these UI elements are mostly not commented due to their repetitive and self explanatory nature.
- * style classes are defined in the style.css file.
- */
- public MainMenu()
- {
- DropShadow dropShadow = new DropShadow();
- dropShadow.setRadius(50.0);
- dropShadow.setColor(Color.WHITE);
- dropShadow.setBlurType(BlurType.GAUSSIAN);
-
- Text title = new Text();
- title.setText("NPE Hero");
- title.getStyleClass().add("t0");
- title.setEffect(dropShadow);
-
- Button play = new Button();
- play.setText("Play");
- play.setOnAction(e -> {Driver.setMenu(new LevelSelector());
- Driver.soundController.playSfx("forward");
- });
-
- Button settings = new Button();
- settings.setText("Settings");
- settings.setOnAction(e -> {Driver.setMenu(new Settings());
- Driver.soundController.playSfx("forward");
- });
-
- Button exit = new Button();
- exit.setText("Quit");
- exit.setOnAction(e -> {Driver.quit();
- Driver.soundController.playSfx("backward");
- });
-
- VBox buttonBox = new VBox();
- buttonBox.getChildren().addAll(play, settings, exit);
- buttonBox.setAlignment(Pos.CENTER);
- buttonBox.setSpacing(10);
-
- VBox centerBox = new VBox();
- centerBox.setAlignment(Pos.CENTER);
- centerBox.getChildren().addAll(title, buttonBox);
- centerBox.setSpacing(10);
-
- VBox rootBox = new VBox();
- rootBox.prefWidthProperty().bind(super.prefWidthProperty());
- rootBox.prefHeightProperty().bind(super.prefHeightProperty());
- rootBox.setAlignment(Pos.CENTER);
- rootBox.getChildren().add(centerBox);
-
- super.getChildren().add(rootBox);
- }
-}