From a5aaec76b15680328c049e0e2ec3367fada630eb Mon Sep 17 00:00:00 2001 From: Sem van der Hoeven Date: Mon, 11 May 2020 09:12:33 +0200 Subject: [PATCH] added new constructors to game config class --- .../game/GameApplicationConfiguration.java | 35 +++++++++++++++++++ .../game/desktop/DesktopLauncher.java | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/core/src/netwerkprog/game/GameApplicationConfiguration.java b/core/src/netwerkprog/game/GameApplicationConfiguration.java index 095adb1..f1b67de 100644 --- a/core/src/netwerkprog/game/GameApplicationConfiguration.java +++ b/core/src/netwerkprog/game/GameApplicationConfiguration.java @@ -35,4 +35,39 @@ public class GameApplicationConfiguration extends LwjglApplicationConfiguration public GameApplicationConfiguration() { this(1920,1080,false); } + + /** + * Makes a new configuration with the given parameters + * @param title the title of the window + * @param width the width in pixels + * @param height the height in pixels + * @param fullscreen if the window should be fullscreen + */ + public GameApplicationConfiguration(String title, int width, int height, boolean fullscreen) { + super(); + super.width = width; + super.height = height; + super.title = title; + super.fullscreen = fullscreen; + } + + /** + * Makes a new configuration with the given parameters. + * fullscreen is off + * @param title the window title + * @param width the width in pixels + * @param height the height in pixels + */ + public GameApplicationConfiguration(String title, int width, int height) { + this(title,width,height,false); + } + + /** + * Makes a new configuration with the given title + * the window will be 1920 x 1080 and fullscreen will be off + * @param title the window title + */ + public GameApplicationConfiguration(String title) { + this(title, 1920,1080); + } } diff --git a/desktop/src/netwerkprog/game/desktop/DesktopLauncher.java b/desktop/src/netwerkprog/game/desktop/DesktopLauncher.java index 199e056..4f6ba0a 100644 --- a/desktop/src/netwerkprog/game/desktop/DesktopLauncher.java +++ b/desktop/src/netwerkprog/game/desktop/DesktopLauncher.java @@ -8,7 +8,7 @@ import temp.Networking; public class DesktopLauncher { public static void main (String[] arg) { - GameApplicationConfiguration config = new GameApplicationConfiguration(1200,800); + GameApplicationConfiguration config = new GameApplicationConfiguration("Netwerk Game",1200,800); new LwjglApplication(new MainGame(), config); } }