From 33a02891fccaffef672009756b35ee68bae058d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Thu, 27 May 2021 02:19:42 +0200 Subject: [PATCH 1/4] =?UTF-8?q?Ajout=20des=20d=C3=A9pendances=20=C3=A0=20J?= =?UTF-8?q?avaFX?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index 438626a..7f927f5 100644 --- a/pom.xml +++ b/pom.xml @@ -90,6 +90,11 @@ lwjgl-stb ${lwjgl.natives} + + org.openjfx + javafx-controls + 11 + https://gitlab.istic.univ-rennes1.fr/fautin/jeu-de-combat From 75865640aa942b5ec07b46673b4f15477aa60d7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Thu, 27 May 2021 03:02:36 +0200 Subject: [PATCH 2/4] =?UTF-8?q?Progr=C3=A8s=20ajout=20Launcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ajout de JavaFX.fxml aux dépendances, aménagement de l'architecture du launcher pour (launcher étend maintenant Application, Main lance correctement le Launcher) --- pom.xml | 8 +++++++- src/Main.java | 14 ++------------ src/launcher/Launcher.java | 17 +++++++++++++---- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 7f927f5..0d19601 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ 3.2.3 natives-windows + 16 @@ -93,7 +94,12 @@ org.openjfx javafx-controls - 11 + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} diff --git a/src/Main.java b/src/Main.java index d4c19c8..7c9120e 100644 --- a/src/Main.java +++ b/src/Main.java @@ -9,25 +9,15 @@ import launcher.Launcher; import engine.Engine; +import javafx.application.Application; public class Main { - // Interface de configuration et lancement - static Launcher launcher = new Launcher(); - // Moteur de jeu static Engine game = new Engine(); public static void main(String[] args) { - - - // Lancement de l'interface de configuration du Jeu - try { - launcher.launch(); - } catch (Exception e) { - e.printStackTrace(); - } - + Application.launch(Launcher.class, args); } } diff --git a/src/launcher/Launcher.java b/src/launcher/Launcher.java index 9e34398..bf346f9 100644 --- a/src/launcher/Launcher.java +++ b/src/launcher/Launcher.java @@ -9,11 +9,20 @@ package launcher; -public class Launcher { +import javafx.application.Application; +import javafx.scene.Group; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.scene.shape.Circle; +import javafx.stage.Stage; +import javafx.fxml.*; - public void launch() throws Exception { - - System.out.println("Hello world!"); +public class Launcher extends Application { + + Parent root = FXMLLoader.load("ui/main.fxml"); + Scene main = new Scene() + + public void start(Stage primaryStage) throws Exception { } From 9ced943c0a2333fea4c922094accc58e71702973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Thu, 27 May 2021 03:04:08 +0200 Subject: [PATCH 3/4] Ajout du fxml du launcher (initial) --- ui/launcher.fxml | 94 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 ui/launcher.fxml diff --git a/ui/launcher.fxml b/ui/launcher.fxml new file mode 100644 index 0000000..f4b5d83 --- /dev/null +++ b/ui/launcher.fxml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + +