Ajustement de la taille des écrans, cartes lieu
This commit is contained in:
parent
b69955273d
commit
44d8ec282e
@ -33,7 +33,7 @@ public class ChoisirJoueur implements Initializable{
|
|||||||
public void initialize(URL arg0, ResourceBundle arg1) {
|
public void initialize(URL arg0, ResourceBundle arg1) {
|
||||||
|
|
||||||
this.buttons = new ArrayList<Button>();
|
this.buttons = new ArrayList<Button>();
|
||||||
|
|
||||||
this.buttons.add(btn1);
|
this.buttons.add(btn1);
|
||||||
this.buttons.add(btn2);
|
this.buttons.add(btn2);
|
||||||
this.buttons.add(btn3);
|
this.buttons.add(btn3);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package ihm.controller;
|
package ihm.controller;
|
||||||
|
|
||||||
|
|
||||||
|
import java.awt.Dimension;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -65,6 +66,8 @@ public class PlateauController implements Initializable {
|
|||||||
public static int DICE_QUATRE = 0;
|
public static int DICE_QUATRE = 0;
|
||||||
public static int DICE_BOTH = 2;
|
public static int DICE_BOTH = 2;
|
||||||
|
|
||||||
|
private final double RES = 200./2250.;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* initialise les données du plateau
|
* initialise les données du plateau
|
||||||
*/
|
*/
|
||||||
@ -103,88 +106,6 @@ public class PlateauController implements Initializable {
|
|||||||
List<ImageView> ivs = this.getLieux();
|
List<ImageView> ivs = this.getLieux();
|
||||||
|
|
||||||
applyImages(cl,ivs);
|
applyImages(cl,ivs);
|
||||||
|
|
||||||
// BUTTONS ETC
|
|
||||||
//System.out.println(this.joueursPane);
|
|
||||||
|
|
||||||
/*
|
|
||||||
this.hboxJoueur.add(joueur1);
|
|
||||||
this.hboxJoueur.add(joueur2);
|
|
||||||
this.hboxJoueur.add(joueur3);
|
|
||||||
this.hboxJoueur.add(joueur4);
|
|
||||||
|
|
||||||
for (HBox hbox : hboxJoueur) {
|
|
||||||
tour.add((AnchorPane) hbox.getChildren().get(0));
|
|
||||||
VBox carte = (VBox) hbox.getChildren().get(1);
|
|
||||||
cartePerso.add((ImageView) carte.getChildren().get(0));
|
|
||||||
btnRevelation.add((Button) carte.getChildren().get(1));
|
|
||||||
VBox info = (VBox) hbox.getChildren().get(2);
|
|
||||||
nomJoueur.add((Label) info.getChildren().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.vboxJoueur.add(joueur5);
|
|
||||||
this.vboxJoueur.add(joueur6);
|
|
||||||
this.vboxJoueur.add(joueur7);
|
|
||||||
this.vboxJoueur.add(joueur8);
|
|
||||||
|
|
||||||
for (VBox vbox : vboxJoueur) {
|
|
||||||
tour.add((AnchorPane) vbox.getChildren().get(0));
|
|
||||||
HBox joueur = (HBox) vbox.getChildren().get(1);
|
|
||||||
VBox carte = (VBox) joueur.getChildren().get(1);
|
|
||||||
cartePerso.add((ImageView) carte.getChildren().get(0));
|
|
||||||
btnRevelation.add((Button) carte.getChildren().get(1));
|
|
||||||
VBox info = (VBox) joueur.getChildren().get(0);
|
|
||||||
nomJoueur.add((Label) info.getChildren().get(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
//initilaisation des boutons se reveler
|
|
||||||
int i = 0;
|
|
||||||
for (Button b : btnRevelation) {
|
|
||||||
int compteur = i;
|
|
||||||
b.setOnAction(e -> {try {seReveler(compteur);} catch (IOException e1) {e1.printStackTrace();}});
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
//initialisation des bouton carte personnage
|
|
||||||
int j = 0;
|
|
||||||
for (ImageView b : cartePerso) {
|
|
||||||
int compteur = j;
|
|
||||||
b.setOnMouseClicked(e -> {try {consulterSaCarte(compteur);} catch (IOException e1) {e1.printStackTrace();}});
|
|
||||||
j++;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
//initialisation des pions
|
|
||||||
VBox pionLieux14 = (VBox) lieux.getChildren().get(0);
|
|
||||||
VBox pionLieux58 = (VBox) lieux.getChildren().get(4);
|
|
||||||
for (int k=0; k<4; k++) {
|
|
||||||
pionLieux.add((Circle) pionLieux14.getChildren().get(k));
|
|
||||||
}
|
|
||||||
for (int k=0; k<4; k++) {
|
|
||||||
pionLieux.add((Circle) pionLieux58.getChildren().get(k));
|
|
||||||
}
|
|
||||||
|
|
||||||
VBox pionVie14 = (VBox) lieux.getChildren().get(0);
|
|
||||||
VBox pionVie58 = (VBox) lieux.getChildren().get(4);
|
|
||||||
for (int k=0; k<4; k++) {
|
|
||||||
pionVie.add((Circle) pionVie14.getChildren().get(k));
|
|
||||||
}
|
|
||||||
for (int k=0; k<4; k++) {
|
|
||||||
pionVie.add((Circle) pionVie58.getChildren().get(k));
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println("Tour du joueur 1");
|
|
||||||
|
|
||||||
try {
|
|
||||||
final URL fxmlURL = getClass().getResource("../ressources/Jouer_tour(1)lancer_des.fxml");
|
|
||||||
final ResourceBundle bundle = ResourceBundle.getBundle("domaine.properties.langue", Locale.ENGLISH);
|
|
||||||
final FXMLLoader fxmlLoader = new FXMLLoader(fxmlURL, bundle);
|
|
||||||
Pane root = fxmlLoader.load();
|
|
||||||
root.setPrefSize(255, 180);
|
|
||||||
tour.get(2).getChildren().setAll(root);
|
|
||||||
} catch (IOException e) {
|
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,9 +131,14 @@ public class PlateauController implements Initializable {
|
|||||||
|
|
||||||
StackPane sp = (StackPane) iv.getParent();
|
StackPane sp = (StackPane) iv.getParent();
|
||||||
iv.setImage(im);
|
iv.setImage(im);
|
||||||
iv.fitHeightProperty().bind(sp.heightProperty());
|
Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
|
||||||
|
iv.setFitWidth(RES*screenSize.width);
|
||||||
|
//iv.fitHeightProperty().bind(sp.heightProperty());
|
||||||
|
//iv.fitWidthProperty().bind(sp.widthProperty());
|
||||||
|
|
||||||
|
iv.setPreserveRatio(true);
|
||||||
|
//iv.fitWidthProperty().bind(sp.widthProperty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private Pane getPaneJoueur(int i) {
|
private Pane getPaneJoueur(int i) {
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@
|
|||||||
<Insets bottom="25.0" />
|
<Insets bottom="25.0" />
|
||||||
</padding>
|
</padding>
|
||||||
</GridPane>
|
</GridPane>
|
||||||
<HBox alignment="CENTER" prefHeight="366.0" prefWidth="1125.0" spacing="50.0">
|
<HBox alignment="CENTER" maxWidth="1280.0" spacing="50.0">
|
||||||
<children>
|
<children>
|
||||||
<VBox alignment="TOP_CENTER">
|
<VBox alignment="TOP_CENTER">
|
||||||
<children>
|
<children>
|
||||||
@ -290,14 +290,14 @@
|
|||||||
</VBox>
|
</VBox>
|
||||||
<VBox alignment="CENTER" spacing="50.0">
|
<VBox alignment="CENTER" spacing="50.0">
|
||||||
<children>
|
<children>
|
||||||
<GridPane alignment="CENTER" hgap="20.0">
|
<GridPane alignment="CENTER" hgap="20.0" maxHeight="-Infinity" prefHeight="250.0">
|
||||||
<columnConstraints>
|
<columnConstraints>
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
<ColumnConstraints />
|
<ColumnConstraints />
|
||||||
<ColumnConstraints hgrow="ALWAYS" />
|
<ColumnConstraints hgrow="ALWAYS" />
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints />
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<GridPane>
|
<GridPane>
|
||||||
@ -324,21 +324,21 @@
|
|||||||
<ColumnConstraints />
|
<ColumnConstraints />
|
||||||
</columnConstraints>
|
</columnConstraints>
|
||||||
<rowConstraints>
|
<rowConstraints>
|
||||||
<RowConstraints />
|
<RowConstraints vgrow="ALWAYS" />
|
||||||
</rowConstraints>
|
</rowConstraints>
|
||||||
<children>
|
<children>
|
||||||
<HBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" spacing="5.0" styleClass="lieux" stylesheets="@style/plateau.css">
|
<HBox alignment="CENTER" spacing="5.0" styleClass="lieux" stylesheets="@style/plateau.css">
|
||||||
<children>
|
<children>
|
||||||
<StackPane HBox.hgrow="NEVER">
|
<StackPane HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="77.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" StackPane.alignment="CENTER" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="63.0" styleClass="lieu" />
|
<FlowPane styleClass="lieu" />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
<StackPane layoutX="39.0" layoutY="12.0" HBox.hgrow="NEVER">
|
<StackPane layoutX="39.0" layoutY="12.0" maxHeight="360.0" HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="40.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="13.0" />
|
<FlowPane />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</children>
|
</children>
|
||||||
@ -353,14 +353,14 @@
|
|||||||
<children>
|
<children>
|
||||||
<StackPane HBox.hgrow="NEVER">
|
<StackPane HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="98.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="64.0" />
|
<FlowPane />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
<StackPane HBox.hgrow="NEVER">
|
<StackPane HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="93.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="69.0" />
|
<FlowPane />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</children>
|
</children>
|
||||||
@ -370,16 +370,16 @@
|
|||||||
</HBox>
|
</HBox>
|
||||||
<HBox alignment="TOP_CENTER" spacing="5.0" styleClass="lieux" stylesheets="@style/plateau.css" GridPane.columnIndex="2">
|
<HBox alignment="TOP_CENTER" spacing="5.0" styleClass="lieux" stylesheets="@style/plateau.css" GridPane.columnIndex="2">
|
||||||
<children>
|
<children>
|
||||||
<StackPane HBox.hgrow="NEVER">
|
<StackPane maxHeight="360.0" HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="111.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="81.0" />
|
<FlowPane />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
<StackPane HBox.hgrow="NEVER">
|
<StackPane maxHeight="360.0" HBox.hgrow="NEVER">
|
||||||
<children>
|
<children>
|
||||||
<ImageView fitHeight="150.0" fitWidth="125.0" pickOnBounds="true" preserveRatio="true" />
|
<ImageView pickOnBounds="true" preserveRatio="true" />
|
||||||
<FlowPane prefHeight="150.0" prefWidth="113.0" />
|
<FlowPane />
|
||||||
</children>
|
</children>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
</children>
|
</children>
|
||||||
|
@ -339,10 +339,5 @@ public class GestionnaireJeu {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
waitPlateau();
|
waitPlateau();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -453,11 +453,12 @@ public class Plateau extends Thread{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Joueur choisirParmisTous(Joueur joueur) {
|
public Joueur choisirParmisTous(Joueur joueur) {
|
||||||
List<Joueur> joueurs = this.getJoueurs();
|
List<Joueur> joueurs = new ArrayList<Joueur>();
|
||||||
|
joueurs.addAll(this.getJoueurs());
|
||||||
|
joueurs.remove(joueur);
|
||||||
return (Joueur) gj.choisir(joueur, joueurs, Joueur.class);
|
return (Joueur) gj.choisir(joueur, joueurs, Joueur.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void updateVieJoueur(Joueur joueur, int damage) {
|
public void updateVieJoueur(Joueur joueur, int damage) {
|
||||||
gj.updateVieJoueur(joueur,damage);
|
gj.updateVieJoueur(joueur,damage);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user