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:
parent
33a02891fc
commit
75865640aa
8
pom.xml
8
pom.xml
@ -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>
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user