Merge branch 'master' into 'engineWIP'

# Conflicts:
#   src/Main.java
This commit is contained in:
François Autin 2021-05-27 11:27:27 +00:00
commit 252c9d3697
4 changed files with 121 additions and 15 deletions

11
pom.xml
View File

@ -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>11</javafx.version>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -90,6 +91,16 @@
<artifactId>lwjgl-stb</artifactId> <artifactId>lwjgl-stb</artifactId>
<classifier>${lwjgl.natives}</classifier> <classifier>${lwjgl.natives}</classifier>
</dependency> </dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
</dependencies> </dependencies>
<url>https://gitlab.istic.univ-rennes1.fr/fautin/jeu-de-combat</url> <url>https://gitlab.istic.univ-rennes1.fr/fautin/jeu-de-combat</url>

View File

@ -9,25 +9,15 @@
import engine.Engine; import engine.Engine;
import launcher.Launcher; import launcher.Launcher;
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();
}
} }
} }

View File

@ -9,12 +9,26 @@
package launcher; 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();
} }
} }

91
ui/launcher.fxml Normal file
View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2015, 2019, Gluon and/or its affiliates.
All rights reserved. Use is subject to license terms.
This file is available and licensed under the following license:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the distribution.
- Neither the name of Oracle Corporation nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<?import javafx.geometry.Rectangle2D?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<HBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" style="-fx-background-color: #151619;" xmlns="http://javafx.com/javafx/16" xmlns:fx="http://javafx.com/fxml/1">
<children>
<VBox prefHeight="400.0" prefWidth="157.0">
<children>
<ImageView accessibleText="Logo" fitHeight="240.0" fitWidth="158.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
</ImageView>
<VBox alignment="BOTTOM_CENTER" prefHeight="263.0" prefWidth="158.0">
<children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<Button mnemonicParsing="false" text="Run" />
</children>
</VBox>
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="176.0" text="Settings" />
<Button mnemonicParsing="false" prefHeight="25.0" prefWidth="161.0" style="-fx-background-color: #e80000;" text="X Quit" textFill="WHITE" />
</children>
</VBox>
</children>
</VBox>
<VBox prefHeight="400.0" prefWidth="455.0">
<children>
<HBox alignment="CENTER" prefHeight="266.0" prefWidth="475.0">
<children>
<VBox alignment="BOTTOM_CENTER" prefHeight="249.0" prefWidth="233.0">
<children>
<ImageView fitHeight="172.0" fitWidth="211.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
<viewport>
<Rectangle2D />
</viewport>
</ImageView>
</children>
</VBox>
<VBox alignment="BOTTOM_CENTER" prefHeight="249.0" prefWidth="233.0">
<children>
<ImageView fitHeight="200.0" fitWidth="233.0" pickOnBounds="true" preserveRatio="true">
<image>
</image>
</ImageView>
</children>
</VBox>
</children>
</HBox>
<HBox prefHeight="168.0" prefWidth="432.0" />
</children></VBox>
</children>
</HBox>