Traduction
This commit is contained in:
@ -16,7 +16,7 @@ public class Main extends Application {
|
||||
public void start(Stage primaryStage) throws Exception {
|
||||
System.out.println("Lancement de l'application");
|
||||
|
||||
final URL fxmlURL = getClass().getResource("ressources/Menu.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
|
||||
final URL fxmlURL = getClass().getResource("ressources/parametre.fxml"); // "ressources/Jouer_tour(1)lancer_des.fxml"
|
||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.FRANCE);
|
||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
||||
Pane root = fxmlLoader.load();
|
||||
|
@ -6,13 +6,22 @@ import java.util.Random;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import carte.CarteLieu;
|
||||
import ihm.SpriteAnimation;
|
||||
import javafx.animation.Animation;
|
||||
import javafx.event.Event;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.geometry.Rectangle2D;
|
||||
import javafx.scene.Group;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.image.ImageView;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.BorderPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.util.Duration;
|
||||
import main.Joueur;
|
||||
|
||||
public class JouerSonTour1Controller implements Initializable{
|
||||
@ -20,10 +29,53 @@ public class JouerSonTour1Controller implements Initializable{
|
||||
|
||||
@FXML private Pane rootPane;
|
||||
@FXML private Label nomJoueur;
|
||||
@FXML private AnchorPane d6;
|
||||
@FXML private AnchorPane d4;
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
//nomJoueur.setText(joueur.getNom());
|
||||
|
||||
int OFFSET_X = 0;
|
||||
int OFFSET_Y = 0;
|
||||
int WIDTH = 200;
|
||||
int HEIGHT = 200;
|
||||
int COUNT = 6;
|
||||
int COLUMNS = 6;
|
||||
|
||||
//anchorPane1.getChildren().setAll(imageView);
|
||||
|
||||
|
||||
ImageView imageView;
|
||||
try {
|
||||
imageView = FXMLLoader.load(getClass().getResource("../ressources/img/des.fxml"));
|
||||
imageView.setViewport(new Rectangle2D(OFFSET_X, OFFSET_Y, WIDTH, HEIGHT));
|
||||
|
||||
imageView.fitWidthProperty().bind(d6.widthProperty());
|
||||
final SpriteAnimation animation = new SpriteAnimation(
|
||||
imageView,
|
||||
Duration.millis(250),
|
||||
COUNT, COLUMNS,
|
||||
OFFSET_X, OFFSET_Y,
|
||||
557, 557
|
||||
);
|
||||
animation.setCycleCount(Animation.INDEFINITE);
|
||||
animation.play();
|
||||
d6.getChildren().addAll(new Group(imageView));
|
||||
d6.setOnMousePressed(new EventHandler<Event>(
|
||||
|
||||
) {
|
||||
|
||||
@Override
|
||||
public void handle(Event arg0) {
|
||||
animation.stop();
|
||||
|
||||
}
|
||||
});
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
52
src/ihm/controller/ParametreController.java
Normal file
52
src/ihm/controller/ParametreController.java
Normal file
@ -0,0 +1,52 @@
|
||||
package ihm.controller;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
import ihm.Musique;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.fxml.Initializable;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.ComboBox;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.Pane;
|
||||
|
||||
public class ParametreController implements Initializable{
|
||||
@FXML private Pane rootPane;
|
||||
@FXML private CheckBox cmusique;
|
||||
@FXML private CheckBox clair;
|
||||
@FXML private ComboBox<String> langues;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||
langues.getItems().add("Anglais");
|
||||
langues.getItems().add("Allemand");
|
||||
langues.getItems().add("Espagnol");
|
||||
langues.getItems().add("Fran<EFBFBD>ais");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/*@FXML
|
||||
public void enregistre(MouseEvent mouseEvent) throws IOException{
|
||||
if(cmusique.isSelected()==true) {
|
||||
|
||||
String filepath = "src//ihm//ressources//musique//The_Red_Fox_Tavern.wav"; // lien vers la musique :
|
||||
// https://www.youtube.com/watch?v=LBpKUIyOHdo
|
||||
Musique musiqueObjet = new Musique();
|
||||
//musiqueObjet.playMusique(filepath);
|
||||
|
||||
Pane root = FXMLLoader.load(getClass().getResource("ressources/parametre.fxml"));
|
||||
//root.setStyle("ressources/style/menuLight.css);
|
||||
|
||||
}
|
||||
|
||||
} */
|
||||
|
||||
}
|
@ -2,28 +2,27 @@
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.AnchorPane?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.shape.Polygon?>
|
||||
<?import javafx.scene.shape.Rectangle?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<Pane fx:id="rootPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="480.0" prefWidth="640.0" stylesheets="@style/popUp.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.JouerSonTour1Controller">
|
||||
<children>
|
||||
<Label layoutX="135.0" layoutY="29.0" text="%au.tour.de">
|
||||
<Label layoutX="135.0" layoutY="29.0" text="C'est au tour de">
|
||||
<font>
|
||||
<Font size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Rectangle arcHeight="5.0" arcWidth="5.0" fill="WHITE" height="174.0" layoutX="130.0" layoutY="149.0" stroke="BLACK" strokeType="INSIDE" width="173.0" />
|
||||
<Polygon fill="WHITE" layoutX="440.0" layoutY="216.0" points="-75.79998779296875, 98.80001831054688, 97.0, 98.80001831054688, 8.20001220703125, -59.199981689453125" stroke="BLACK" strokeType="INSIDE" />
|
||||
<Button layoutX="262.0" layoutY="388.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="%lancer.de.des">
|
||||
<Button layoutX="262.0" layoutY="388.0" mnemonicParsing="false" onMouseClicked="#lancerDes" text="Lancer les d<>s">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font></Button>
|
||||
<Label fx:id="nomJoueur" layoutX="405.0" layoutY="29.0" text="%joueur1">
|
||||
<Label fx:id="nomJoueur" layoutX="405.0" layoutY="29.0" text="joueur 1">
|
||||
<font>
|
||||
<Font size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<AnchorPane fx:id="d6" layoutX="91.0" layoutY="140.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
<AnchorPane fx:id="d4" layoutX="379.0" layoutY="140.0" prefHeight="200.0" prefWidth="200.0" />
|
||||
</children>
|
||||
</Pane>
|
||||
</Pane>
|
BIN
src/ihm/ressources/img/dice.sprite.png
Normal file
BIN
src/ihm/ressources/img/dice.sprite.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 53 KiB |
42
src/ihm/ressources/parametre.fxml
Normal file
42
src/ihm/ressources/parametre.fxml
Normal file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<?import javafx.scene.control.ComboBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<Pane fx:id="rootPane" prefHeight="595.0" prefWidth="758.0" styleClass="background" stylesheets="@style/menu.css" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="ihm.controller.ParametreController">
|
||||
<children>
|
||||
<HBox alignment="TOP_CENTER" layoutX="146.0" layoutY="171.0" prefHeight="242.0" prefWidth="507.0" spacing="10.0">
|
||||
<children>
|
||||
<VBox prefHeight="309.0" prefWidth="127.0" spacing="50.0">
|
||||
<children>
|
||||
<CheckBox fx:id="clair" mnemonicParsing="false" styleClass="checkBox" text="Mode clair" />
|
||||
<CheckBox fx:id="cmusique" mnemonicParsing="false" styleClass="checkBox" text="Musique" />
|
||||
<CheckBox mnemonicParsing="false" styleClass="checkBox" text="Effet" />
|
||||
<VBox prefHeight="200.0" prefWidth="100.0" spacing="10.0">
|
||||
<children>
|
||||
<Label styleClass="titre" text="Langue">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ComboBox fx:id="langues" prefHeight="26.0" prefWidth="90.0" />
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</HBox>
|
||||
<Label layoutX="309.0" layoutY="23.0" styleClass="titre" text="Paramètre">
|
||||
<font>
|
||||
<Font size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button layoutX="340.0" layoutY="525.0" mnemonicParsing="false" styleClass="bouton" stylesheets="@style/menu.css" text="Enregistrer" />
|
||||
</children>
|
||||
</Pane>
|
@ -13,4 +13,12 @@
|
||||
-fx-background-color: #1d1d1d;
|
||||
-fx-text-fill: #d8d8d8;
|
||||
-fx-background-insets: 0 0 0 0, 0, 1, 2;
|
||||
}
|
||||
}
|
||||
.checkBox {
|
||||
|
||||
-fx-border-width: 2;
|
||||
-fx-background-radius: 0;
|
||||
-fx-background-color: #1d1d1d;
|
||||
-fx-text-fill: #d8d8d8;
|
||||
-fx-background-insets: 0 0 0 0, 0, 1, 2;
|
||||
}
|
||||
|
Reference in New Issue
Block a user