Skip to content
Snippets Groups Projects
Commit 099d9438 authored by Max Wittig's avatar Max Wittig
Browse files

fixed settings

parent c1cc563c
No related branches found
No related tags found
No related merge requests found
package de.bricked.game.settings;
import de.bricked.main.Main;
import javafx.stage.Screen;
import java.awt.*;
public enum GameSize
{
SMALL(800, 600),
......@@ -21,8 +24,9 @@ public enum GameSize
GameSize()
{
this.width = (int)(Screen.getPrimary().getVisualBounds().getWidth());
this.height = (int)(Screen.getPrimary().getVisualBounds().getHeight());
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
this.width = gd.getDisplayMode().getWidth();
this.height = gd.getDisplayMode().getHeight();
}
public int getWidth()
......
......@@ -71,7 +71,7 @@ public class Settings
}
}
public void load() throws Exception
private void load() throws Exception
{
String jsonContent = new String(Files.readAllBytes(FileSystems.getDefault().getPath(PathUtils.getOSindependentPath().toAbsolutePath() + directory + filename)));
Settings loadedSettings = gson.fromJson(jsonContent, Settings.class);
......
......@@ -11,6 +11,7 @@ import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Screen;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import logger.LogLevel;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment