Progrès ajout Launcher

Ajout de JavaFX.fxml aux dépendances, aménagement de l'architecture du
launcher pour (launcher étend maintenant Application, Main lance
correctement le Launcher)
This commit is contained in:
François Autin 2021-05-27 03:02:36 +02:00
parent 33a02891fc
commit 75865640aa
3 changed files with 22 additions and 17 deletions

View File

@ -21,6 +21,7 @@
<properties>
<lwjgl.version>3.2.3</lwjgl.version>
<lwjgl.natives>natives-windows</lwjgl.natives>
<javafx.version>16</javafx.version>
</properties>
<dependencyManagement>
@ -93,7 +94,12 @@
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
</dependencies>

View File

@ -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);
}
}

View File

@ -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 {
}