aboutsummaryrefslogtreecommitdiff
path: root/src/gui/LevelSurround.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2023-06-05 23:15:13 -0400
committersowgro <tpoke.ferrari@gmail.com>2023-06-05 23:15:13 -0400
commitc94726840b869a41ea82f0d69e163a260c433c79 (patch)
treea4d56ff9d76b5963ba2bd20bc25e337790b8d976 /src/gui/LevelSurround.java
parent5f6b84a1d3a4cf1936e7d495d03400ce5c7478f6 (diff)
downloadNPEhero-c94726840b869a41ea82f0d69e163a260c433c79.tar.gz
NPEhero-c94726840b869a41ea82f0d69e163a260c433c79.tar.bz2
NPEhero-c94726840b869a41ea82f0d69e163a260c433c79.zip
improve level surround contrast, add key labels
Diffstat (limited to 'src/gui/LevelSurround.java')
-rw-r--r--src/gui/LevelSurround.java35
1 files changed, 28 insertions, 7 deletions
diff --git a/src/gui/LevelSurround.java b/src/gui/LevelSurround.java
index 3739879..758a420 100644
--- a/src/gui/LevelSurround.java
+++ b/src/gui/LevelSurround.java
@@ -9,6 +9,7 @@ import gameplay.SongPlayer;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
+import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
@@ -55,10 +56,15 @@ public class LevelSurround extends Pane
VBox titleTextBox = new VBox();
titleTextBox.setAlignment(Pos.TOP_RIGHT);
titleTextBox.getChildren().addAll(title, artist);
-
- BorderPane topBar = new BorderPane();
- topBar.setLeft(buttonBox);
- topBar.setRight(titleTextBox);
+ titleTextBox.getStyleClass().add("box");
+ titleTextBox.setPadding(new Insets(10));
+
+ AnchorPane topBar = new AnchorPane();
+ topBar.getChildren().addAll(buttonBox,titleTextBox);
+ topBar.setLeftAnchor(buttonBox, 0.0);
+ topBar.setRightAnchor(titleTextBox, 0.0);
+ topBar.setTopAnchor(buttonBox, 0.0);
+ topBar.setTopAnchor(titleTextBox, 0.0);
topBar.setPadding(new Insets(10));
@@ -74,7 +80,14 @@ public class LevelSurround extends Pane
scoreTextBox.setAlignment(Pos.BOTTOM_LEFT);
scoreTextBox.getChildren().addAll(scoreLabel,scoreDisplay);
scoreTextBox.setPadding(new Insets(10));
+ scoreTextBox.getStyleClass().add("box");
+ scoreTextBox.minWidthProperty().bind(scoreTextBox.heightProperty());
+ AnchorPane scoreBox = new AnchorPane();
+ scoreBox.getChildren().add(scoreTextBox);
+ scoreBox.setLeftAnchor(scoreTextBox, 0.0);
+ scoreBox.setBottomAnchor(scoreTextBox, 0.0);
+ scoreBox.setPadding(new Insets(10));
Text comboLabel = new Text();
comboLabel.setText("Combo:");
@@ -88,17 +101,25 @@ public class LevelSurround extends Pane
comboTextBox.setAlignment(Pos.BOTTOM_RIGHT);
comboTextBox.getChildren().addAll(comboLabel,comboDisplay);
comboTextBox.setPadding(new Insets(10));
+ comboTextBox.getStyleClass().add("box");
+ comboTextBox.minWidthProperty().bind(comboTextBox.heightProperty());
+
+ AnchorPane comboBox = new AnchorPane();
+ comboBox.getChildren().add(comboTextBox);
+ comboBox.setRightAnchor(comboTextBox, 0.0);
+ comboBox.setBottomAnchor(comboTextBox, 0.0);
+ comboBox.setPadding(new Insets(10));
game.minWidthProperty().bind(super.prefHeightProperty().multiply(0.66));
game.minHeightProperty().bind(super.prefHeightProperty());
game.getStyleClass().add("box");
- comboTextBox.minWidthProperty().bind(super.prefWidthProperty().subtract(game.minWidthProperty()).divide(2));
- scoreTextBox.minWidthProperty().bind(super.prefWidthProperty().subtract(game.minWidthProperty()).divide(2));
+ comboBox.minWidthProperty().bind(super.prefWidthProperty().subtract(game.minWidthProperty()).divide(2));
+ scoreBox.minWidthProperty().bind(super.prefWidthProperty().subtract(game.minWidthProperty()).divide(2));
HBox centerBox = new HBox();
- centerBox.getChildren().addAll(comboTextBox, game, scoreTextBox);
+ centerBox.getChildren().addAll(comboBox, game, scoreBox);
centerBox.setAlignment(Pos.BOTTOM_CENTER);
StackPane root = new StackPane();