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>
|
<properties>
|
||||||
<lwjgl.version>3.2.3</lwjgl.version>
|
<lwjgl.version>3.2.3</lwjgl.version>
|
||||||
<lwjgl.natives>natives-windows</lwjgl.natives>
|
<lwjgl.natives>natives-windows</lwjgl.natives>
|
||||||
|
<javafx.version>16</javafx.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
@ -93,7 +94,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-controls</artifactId>
|
<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>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
@ -9,25 +9,15 @@
|
|||||||
|
|
||||||
import launcher.Launcher;
|
import launcher.Launcher;
|
||||||
import engine.Engine;
|
import engine.Engine;
|
||||||
|
import javafx.application.Application;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
// Interface de configuration et lancement
|
|
||||||
static Launcher launcher = new Launcher();
|
|
||||||
|
|
||||||
// Moteur de jeu
|
// Moteur de jeu
|
||||||
static Engine game = new Engine();
|
static Engine game = new Engine();
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
Application.launch(Launcher.class, args);
|
||||||
|
|
||||||
// Lancement de l'interface de configuration du Jeu
|
|
||||||
try {
|
|
||||||
launcher.launch();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,11 +9,20 @@
|
|||||||
|
|
||||||
package launcher;
|
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 {
|
public class Launcher extends Application {
|
||||||
|
|
||||||
System.out.println("Hello world!");
|
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