Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Fix info panel not displaying proper for some board sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
Subby committed May 22, 2016
1 parent aa370b8 commit 3b9e9b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/aston/group12/view/MainGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ private Pane infoPanel() {
Stage stage = (Stage) button.getScene().getWindow();
loadMainMenu(stage);
});
int offset = Settings.getSingleton().getBoardWidth();
button.setTranslateY(150);
currentTurnLabel.setText(gameSession.getPlayer(turnIndex).getName() + "'s turn");
currentTurnLabel.setTextFill(Color.valueOf(gameSession.getPlayer(turnIndex).getPawnColour()));
Expand All @@ -114,7 +115,13 @@ private Pane infoPanel() {
wallsLabel.setTextFill(Color.valueOf(gameSession.getPlayer(turnIndex).getPawnColour()));
wallsLabel.setTranslateY(50);
panel.getChildren().addAll(currentTurnLabel, wallsLabel, button);
panel.setTranslateX(450);
if(offset == 7) {
panel.setTranslateX(350);
} else if(offset == 11) {
panel.setTranslateX(550);
} else {
panel.setTranslateX(450);
}
return panel;
}

Expand Down

0 comments on commit 3b9e9b1

Please sign in to comment.