Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI css #4

Merged
merged 3 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ public void initialize(URL url, ResourceBundle rb) {
Image critImage = new Image("file:turingmachine/src/main/resources/com/turingmachine/gui/imgs/"+critCard.getId()+".png");
selectedImage.setImage(critImage);
selectedImage.setPreserveRatio(true);
selectedImage.setFitWidth(150);
selectedImage.setFitHeight(150);
selectedImage.setFitWidth(200);
selectedImage.setFitHeight(200);

selectedImage.setOnMouseClicked(e -> {
if (singleton.canCheckAnotherCriteria()) {
Expand All @@ -76,7 +76,7 @@ public void initialize(URL url, ResourceBundle rb) {
i++;
}
mygpane.setLayoutX(25);
mygpane.setLayoutY(250);
mygpane.setLayoutY(0);

this.myPane.getChildren().addAll(mygpane);
System.out.println("CriteriaCardSelectionController initialized");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import javafx.scene.text.Font;

import java.io.File;
import java.io.IOException;
Expand All @@ -22,7 +23,10 @@ public class TuringMachine extends Application {

@Override
public void start(Stage stage) throws IOException {
scene = new Scene(loadFXML("main-menu").load(), 640, 480);
// Font.loadFont(getClass().getResourceAsStream("C:/Users/pourc/Desktop/AP4B_TuringMachine/turingmachine/src/main/resources/com/turingmachine/gui/font/PressStart2P-Regular.ttf"), 14);
stage.setResizable(false); // Empêche la redimension de la fenêtre

scene = new Scene(loadFXML("main-menu").load(), 800, 800);
stage.setScene(scene);
stage.setTitle("TuringMachine");
game = new Game();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public void initialize(URL url, ResourceBundle rb) {
singleton.addUsernameTextField(tf);
}
gPane.setHgap(10);
gPane.setLayoutX(150);
gPane.setLayoutY(200);
gPane.setLayoutX(325);
gPane.setLayoutY(300);
this.myPane.getChildren().addAll(gPane);
System.out.println("UsernameController initialized");
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
AnchorPane {
-fx-background-image: url('coffre.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #ffffff;
}

Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.image.Image?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.text.Font?>

<AnchorPane fx:id="myPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.CriteriaCardSelectionController">
<AnchorPane fx:id="myPane" maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800.0" prefWidth="800.0" stylesheets="@criteria-card-selection.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.CriteriaCardSelectionController">
<children>
<Label layoutX="213.0" layoutY="67.0" text="Turing Machine">
<font>
<Font size="42.0" />
</font>
</Label>
<Label layoutX="155.0" layoutY="183.0" text="Quelle(s) cartes voulez-vous tester ?">
<Label layoutX="210.0" layoutY="162.0" text="Quelle(s) cartes voulez-vous tester ?">
<font>
<Font size="24.0" />
</font>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
AnchorPane {
-fx-background-image: url('office.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #ffffff;
}


Button {
-fx-font-family: "Impact";
-fx-background-color: #d58d0f;
-fx-text-fill: #ffffff;
-fx-font-size: 18px;
-fx-background-radius: 30px;
}

Button:hover {
-fx-background-color: #fffffe;
-fx-text-fill: #000000;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.DifficultyMenuController">
<AnchorPane maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800.0" prefWidth="800.0" stylesheets="@difficulty-menu.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.DifficultyMenuController">
<children>
<Label layoutX="138.0" layoutY="59.0" text="Turing Machine">
<font>
<Font size="42.0" />
</font>
</Label>
<Button layoutX="371.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#selectHardMode" text="Difficile" />
<Button layoutX="261.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#selectMediumMode" text="Moyen" />
<Button layoutX="148.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#selectEasyMode" text="Facile" />
<Label layoutX="135.0" layoutY="153.0" text="Choisissez une difficulté">
<Button layoutX="605.0" layoutY="481.0" mnemonicParsing="false" onMouseClicked="#selectHardMode" text="Difficile" />
<Button layoutX="346.0" layoutY="481.0" mnemonicParsing="false" onMouseClicked="#selectMediumMode" text="Moyen" />
<Button layoutX="80.0" layoutY="481.0" mnemonicParsing="false" onMouseClicked="#selectEasyMode" text="Facile" />
<Label layoutX="261.0" layoutY="184.0" text="Choisissez une difficulté">
<font>
<Font size="24.0" />
</font>
</Label>
<Button layoutX="273.0" layoutY="352.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
<Button layoutX="419.0" layoutY="640.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
<Button layoutX="249.0" layoutY="640.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu Précedent" />
</children>
</AnchorPane>
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* @font-face {
font-family: 'Press Start 2P';
src: url('C:/Users/pourc/Desktop/AP4B_TuringMachine/turingmachine/src/main/resources/com/turingmachine/gui/font/PressStart2P-Regular.ttf');
} */
AnchorPane {
-fx-background-image: url('menu.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #efea40;
}


Button {
-fx-font-family: "Impact";
-fx-background-color: #040504;
-fx-text-fill: #ffffff;
-fx-font-size: 18px;
-fx-background-radius: 30px;
}

Button:hover {
-fx-background-color: #fffffe;
-fx-text-fill: #000000;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.MainMenuController">
<AnchorPane maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800.0" prefWidth="800.0" stylesheets="@main-menu.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.MainMenuController">
<children>
<Label layoutX="138.0" layoutY="59.0" text="Turing Machine">
<Label layoutX="14.0" layoutY="38.0" text="Turing Machine">
<font>
<Font size="42.0" />
<Font name="HoloLens MDL2 Assets" size="40.0" />
</font>
</Label>
<Label layoutX="169.0" layoutY="159.0" text="Choisissez une option">
<Label layoutX="292.0" layoutY="400.0" text="Choisissez une option">
<font>
<Font size="24.0" />
</font>
</Label>
<Button layoutX="273.0" layoutY="333.0" mnemonicParsing="false" onMouseClicked="#quit" text="Quitter" />
<Button layoutX="244.0" layoutY="277.0" mnemonicParsing="false" onMouseClicked="#showHighScores" text="Meilleurs scores" />
<Button layoutX="274.0" layoutY="229.0" mnemonicParsing="false" onMouseClicked="#startGame" text="Jouer" />
<Button layoutX="280.0" layoutY="605.0" mnemonicParsing="false" onMouseClicked="#quit" prefHeight="62.0" prefWidth="240.0" text="Quitter" />
<Button layoutX="280.0" layoutY="528.0" mnemonicParsing="false" onMouseClicked="#showHighScores" prefHeight="62.0" prefWidth="240.0" text="Meilleurs scores" />
<Button layoutX="284.0" layoutY="450.0" mnemonicParsing="false" onMouseClicked="#startGame" prefHeight="62.0" prefWidth="231.0" text="Jouer" />
<Label layoutX="47.0" layoutY="87.0" prefHeight="58.0" prefWidth="185.0" text="UTBM Thief Version">
<font>
<Font name="HoloLens MDL2 Assets" size="22.0" />
</font>
</Label>
</children>
</AnchorPane>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
AnchorPane {
-fx-background-image: url('player.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #000000;
}


Button {
-fx-font-family: "Impact";
-fx-background-color: #040504;
-fx-text-fill: #ffffff;
-fx-font-size: 18px;
-fx-background-radius: 30px;
}

Button:hover {
-fx-background-color: #fffffe;
-fx-text-fill: #000000;

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.text.Font?>

<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.PlayerMenuController">
<AnchorPane maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800.0" prefWidth="800.0" stylesheets="@player-menu.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.PlayerMenuController">
<children>
<Label layoutX="138.0" layoutY="59.0" text="Turing Machine">
<Label layoutX="72.0" layoutY="14.0" text="Turing Machine">
<font>
<Font size="42.0" />
</font>
</Label>
<Button layoutX="115.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#selectSolo" text="Solo" />
<Button layoutX="436.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#select4Player" text="4 joueurs" />
<Button layoutX="320.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#select3Player" text="3 joueurs" />
<Button layoutX="201.0" layoutY="232.0" mnemonicParsing="false" onMouseClicked="#select2Player" text="2 joueurs" />
<Label layoutX="106.0" layoutY="153.0" text="Choisissez le nombre de joueurs">
<Button layoutX="162.0" layoutY="420.0" mnemonicParsing="false" onMouseClicked="#selectSolo" text="Solo" />
<Button layoutX="489.0" layoutY="420.0" mnemonicParsing="false" onMouseClicked="#select4Player" text="4 joueurs" />
<Button layoutX="366.0" layoutY="420.0" mnemonicParsing="false" onMouseClicked="#select3Player" text="3 joueurs" />
<Button layoutX="237.0" layoutY="420.0" mnemonicParsing="false" onMouseClicked="#select2Player" text="2 joueurs" />
<Label layoutX="206.0" layoutY="204.0" text="Choisissez le nombre de joueurs">
<font>
<Font size="24.0" />
</font>
</Label>
<Button layoutX="273.0" layoutY="352.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
<Button layoutX="348.0" layoutY="592.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
</children>
</AnchorPane>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
AnchorPane {
-fx-background-image: url('punchcard.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #000000;
}


Button {
-fx-font-family: "Impact";
-fx-background-color: #040504;
-fx-text-fill: #ffffff;
-fx-font-size: 18px;
-fx-background-radius: 30px;
}

Button:hover {
-fx-background-color: #fffffe;
-fx-text-fill: #000000;

}

Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,24 @@
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Spinner?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.shape.Circle?>
<?import javafx.scene.shape.Polygon?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>

<AnchorPane fx:id="myPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.PunchCardSelectionController">
<AnchorPane fx:id="myPane" maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800.0" prefWidth="800.0" stylesheets="@punchcard-selection.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.PunchCardSelectionController">
<children>
<Label layoutX="138.0" layoutY="59.0" text="Turing Machine">
<font>
<Font size="42.0" />
</font>
</Label>
<Label layoutX="140.0" layoutY="157.0" text="Choisissez le code à tester">
<Label layoutX="270.0" layoutY="318.0" text="Choisissez le code à tester">
<font>
<Font size="24.0" />
</font>
</Label>
<Spinner fx:id="blue" initialValue="1" layoutX="148.0" layoutY="237.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Spinner fx:id="yellow" initialValue="1" layoutX="260.0" layoutY="237.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Spinner fx:id="purple" initialValue="1" layoutX="374.0" layoutY="237.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Button layoutX="268.0" layoutY="312.0" mnemonicParsing="false" onMouseClicked="#validate" text="Valider" />
<Spinner fx:id="blue" initialValue="1" layoutX="244.0" layoutY="400.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Spinner fx:id="yellow" initialValue="1" layoutX="371.0" layoutY="400.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Spinner fx:id="purple" initialValue="1" layoutX="494.0" layoutY="400.0" max="5" min="1" prefHeight="19.0" prefWidth="79.0" />
<Button layoutX="363.0" layoutY="535.0" mnemonicParsing="false" onMouseClicked="#validate" text="Valider" />
<Circle fill="#9b55b4" layoutX="534.0" layoutY="378.0" radius="18.0" stroke="BLACK" strokeType="INSIDE" />
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="#ffe21f" height="35.0" layoutX="393.0" layoutY="361.0" stroke="BLACK" strokeType="INSIDE" width="36.0" />
<Polygon fill="#5290c9" layoutX="284.0" layoutY="363.0" points="-19.20001220703125, 32.399993896484375, 16.79998779296875, 32.399993896484375, -1.5999755859375, -3.600006103515625" stroke="BLACK" strokeType="INSIDE" />
</children>
</AnchorPane>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
AnchorPane {
-fx-background-image: url('computer.png');
-fx-background-size: cover;
-fx-background-repeat: no-repeat;
}


Label {
-fx-font-family: "Impact";
-fx-text-fill: #000000;
}


Button {
-fx-font-family: "Impact";
-fx-background-color: #040504;
-fx-text-fill: #ffffff;
-fx-font-size: 18px;
-fx-background-radius: 30px;
}

Button:hover {
-fx-background-color: #fffffe;
-fx-text-fill: #000000;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.text.Font?>

<AnchorPane fx:id="myPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="720.0" prefWidth="1280.0" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.UsernameController">
<AnchorPane fx:id="myPane" maxHeight="800" maxWidth="800" minHeight="800" minWidth="800" prefHeight="800" prefWidth="800" stylesheets="@username-selection.css" xmlns="http://javafx.com/javafx/21" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.turingmachine.gui.UsernameController">
<children>
<Label layoutX="138.0" layoutY="59.0" text="Turing Machine">
<font>
<Font size="42.0" />
</font>
</Label>
<Label layoutX="106.0" layoutY="153.0" text="Choisissez vos pseudos">
<Label layoutX="283.0" layoutY="249.0" text="Choisissez vos pseudos">
<font>
<Font size="24.0" />
</font>
</Label>
<Button layoutX="273.0" layoutY="352.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
<Button layoutX="323.0" layoutY="352.0" mnemonicParsing="false" onMouseClicked="#validate" text="Valider" />
<Button layoutX="328.0" layoutY="520.0" mnemonicParsing="false" onMouseClicked="#backToMainMenu" text="Menu" />
<Button layoutX="400.0" layoutY="520.0" mnemonicParsing="false" onMouseClicked="#validate" text="Valider" />
</children>
</AnchorPane>