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/Settings.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/Settings.java')
-rw-r--r-- | src/gui/Settings.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gui/Settings.java b/src/gui/Settings.java index 94c2a89..946be85 100644 --- a/src/gui/Settings.java +++ b/src/gui/Settings.java @@ -1,12 +1,12 @@ package gui; -import javafx.event.ActionEvent; -import javafx.event.EventHandler; import javafx.geometry.Pos; import javafx.scene.control.Button; import javafx.scene.control.Slider; +import javafx.scene.layout.HBox; import javafx.scene.layout.Pane; import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; import javafx.scene.text.Text; public class Settings extends Pane @@ -15,6 +15,7 @@ public class Settings extends Pane { Text t1 = new Text(); t1.setText("Music Volume"); + t1.setFill(Color.WHITE); Slider musicVol = new Slider(); musicVol.setMax(100); @@ -22,6 +23,7 @@ public class Settings extends Pane Text t2 = new Text(); t2.setText("Sound Effects Volume"); + t2.setFill(Color.WHITE); Slider sfxVol = new Slider(); sfxVol.setMax(100); @@ -29,25 +31,26 @@ public class Settings extends Pane Button devMenu = new Button(); devMenu.setText("Debug Menu"); - devMenu.setOnAction(new EventHandler<ActionEvent>() - { - @Override - public void handle(ActionEvent event) - { - Driver.setBackground("assets/trees.png"); - } - }); + devMenu.setOnAction(e -> Driver.setBackground("assets/trees.png")); Button exit = new Button(); exit.setText("Exit"); - exit.setOnAction(e -> Driver.switchMenu("MainMenu")); + exit.setOnAction(e -> Driver.setMenu("MainMenu")); VBox options = new VBox(); + options.setSpacing(10); options.setAlignment(Pos.CENTER); options.getChildren().addAll(t1,musicVol,t2,sfxVol,devMenu,exit); - options.minWidthProperty().bind(super.widthProperty()); + options.minWidthProperty().bind(super.widthProperty().multiply(0.25)); options.minHeightProperty().bind(super.heightProperty()); - super.getChildren().add(options); + //options.getStyleClass().add("textBox"); + + HBox rootBox = new HBox(); + rootBox.minWidthProperty().bind(super.widthProperty()); + rootBox.minHeightProperty().bind(super.heightProperty()); + rootBox.getChildren().add(options); + rootBox.setAlignment(Pos.CENTER); + super.getChildren().add(rootBox); } } |