diff --git a/pom.xml b/pom.xml index 438626a..ae435b3 100644 --- a/pom.xml +++ b/pom.xml @@ -21,6 +21,7 @@ 3.2.3 natives-windows + 11 @@ -90,6 +91,16 @@ lwjgl-stb ${lwjgl.natives} + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + https://gitlab.istic.univ-rennes1.fr/fautin/jeu-de-combat diff --git a/src/Main.java b/src/Main.java index c769c8c..601def5 100644 --- a/src/Main.java +++ b/src/Main.java @@ -9,25 +9,15 @@ import engine.Engine; import launcher.Launcher; +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..5710657 100644 --- a/src/launcher/Launcher.java +++ b/src/launcher/Launcher.java @@ -9,12 +9,26 @@ package launcher; -public class Launcher { +import java.io.FileInputStream; - public void launch() throws Exception { +import javafx.application.Application; +import javafx.scene.Parent; +import javafx.scene.Scene; +import javafx.stage.Stage; +import javafx.fxml.*; + +public class Launcher extends Application { + + public void start(Stage primaryStage) throws Exception { + FileInputStream r_launcher = new FileInputStream("ui/launcher.fxml"); + FXMLLoader floader = new FXMLLoader(); + Parent root = floader.load(r_launcher); + Scene main = root.getScene(); - System.out.println("Hello world!"); + primaryStage.setTitle("Boulevard Combattant"); + primaryStage.setScene(main); + primaryStage.show(); } } diff --git a/ui/launcher.fxml b/ui/launcher.fxml new file mode 100644 index 0000000..a843edc --- /dev/null +++ b/ui/launcher.fxml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + +