From a645b476202bd5b44ab5c22253a70269409b5674 Mon Sep 17 00:00:00 2001 From: sowgro Date: Thu, 5 Sep 2024 22:27:14 -0400 Subject: Add gui scale and other fixes - add gui scaling and options in settings - song with endTime of 0 will now properly get time from song length - suppress unchecked warnings in levelapi --- src/main/java/net/sowgro/npehero/Driver.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/net/sowgro/npehero/Driver.java') diff --git a/src/main/java/net/sowgro/npehero/Driver.java b/src/main/java/net/sowgro/npehero/Driver.java index 411bf87..89381aa 100755 --- a/src/main/java/net/sowgro/npehero/Driver.java +++ b/src/main/java/net/sowgro/npehero/Driver.java @@ -54,6 +54,13 @@ public class Driver extends Application StackPane root = new StackPane(backgroundImage2, backgroundImage, primaryPane); Scene primaryScene = new Scene(root, 800,600); + primaryPane.scaleXProperty().bind(Settings.guiScale); + primaryPane.scaleYProperty().bind(Settings.guiScale); + primaryPane.minHeightProperty().bind(root.heightProperty().divide(Settings.guiScale)); + primaryPane.minWidthProperty() .bind(root.widthProperty() .divide(Settings.guiScale)); + primaryPane.maxHeightProperty().bind(root.heightProperty().divide(Settings.guiScale)); + primaryPane.maxWidthProperty() .bind(root.widthProperty() .divide(Settings.guiScale)); + // Cant figure out how to center this backgroundImage.fitHeightProperty().bind(primaryScene.heightProperty()); backgroundImage2.fitHeightProperty().bind(primaryScene.heightProperty()); -- cgit v1.2.3