Correction de quelques propriétés de Cell et modification de Window

This commit is contained in:
Valentin Lucas 2021-12-08 09:12:45 +01:00
parent 2e5fcd2a05
commit 6e13a3124e
2 changed files with 7 additions and 7 deletions

View File

@ -48,8 +48,8 @@ public class Cell extends Rectangle {
} }
ImageView iv = new ImageView(in); ImageView iv = new ImageView(in);
iv.setFitHeight(40); iv.setFitHeight(Window.cellSize);
iv.setFitWidth(40); iv.setFitWidth(Window.cellSize);
sp.getChildren().add(iv); sp.getChildren().add(iv);
return sp; return sp;
} }

View File

@ -24,9 +24,11 @@ import javafx.stage.Stage;
public class Window extends AbstractView { public class Window extends AbstractView {
//il faut pouvoir trouver une formule responsive avec width et height
public static final int cellSize = 40; public static final int cellSize = 40;
public static final int width = 24; public static final int width = 500;
public static final int height = 16; public static final int height = 160;
private final Stage stage; private final Stage stage;
@ -58,7 +60,7 @@ public class Window extends AbstractView {
private Parent createContent() { private Parent createContent() {
Pane principalPane = new Pane(); Pane principalPane = new Pane();
principalPane.setPrefSize(width * cellSize, height * cellSize); // TODO: 04/12/2021 A corriger -> doit plutôt s'adapter à la taille de la grid (grid.getRow() et grid.getColumn()) principalPane.setPrefSize(game.getGrid().getRow() * cellSize + width, game.getGrid().getColumn() * cellSize + height); // TODO: 04/12/2021 A corriger -> doit plutôt s'adapter à la taille de la grid (grid.getRow() et grid.getColumn())
for (int i = 0; i < game.getGrid().getRow(); i++) { for (int i = 0; i < game.getGrid().getRow(); i++) {
for (int j = 0; j < game.getGrid().getColumn(); j++) { for (int j = 0; j < game.getGrid().getColumn(); j++) {
Cell cell = new Cell(i, j); Cell cell = new Cell(i, j);
@ -96,7 +98,6 @@ public class Window extends AbstractView {
principalPane.getChildren().add(sp); principalPane.getChildren().add(sp);
} }
// TODO: 07/12/2021 WARNING : générer autant de frames quil y a de joueurs,(à implémenter)
// TODO: 07/12/2021 Maintenant régler : Responsive // TODO: 07/12/2021 Maintenant régler : Responsive
@ -117,7 +118,6 @@ public class Window extends AbstractView {
"Energie : " + game.getPlayers().get(playerNumber).getEnergy() + "\n" + "Energie : " + game.getPlayers().get(playerNumber).getEnergy() + "\n" +
"Arme : " + game.getPlayers().get(playerNumber).getWeapon().getClass().getSimpleName() + "\n"; "Arme : " + game.getPlayers().get(playerNumber).getWeapon().getClass().getSimpleName() + "\n";
Text t = new Text(s); Text t = new Text(s);
Rectangle r = new Rectangle(); Rectangle r = new Rectangle();
r.setWidth(500); r.setWidth(500);
r.setHeight(90); r.setHeight(90);