Skip to content
Snippets Groups Projects
Commit d8f1800d authored by Anton Danilov's avatar Anton Danilov Committed by Anton Danilov
Browse files

#456 When adjusting bounds, buttons are now repositioned correctly

parent 423b2a15
No related branches found
No related tags found
No related merge requests found
......@@ -246,10 +246,10 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
private void setUpSizeAndPositionOfComponents() {
if (playSoundScreen != null) playSoundScreen.setBounds(0, getViewportBottomY(), getViewportWidth(), getViewportHeight());
startButton.setPosition(getViewportWidth() - actionsStripWidget.getWidth() - START_BUTTON_WIDTH - START_BUTTON_OFFSET_X,
if(startButton != null) startButton.setPosition(getViewportWidth() - actionsStripWidget.getWidth() - startButton.getWidth() - START_BUTTON_OFFSET_X,
getViewportBottomY() + BOTTOM_OFFSET_Y);
replayButton.setPosition(getViewportWidth() - actionsStripWidget.getWidth() - START_BUTTON_WIDTH - REPLAY_BUTTON_WIDTH - START_BUTTON_OFFSET_X * 2,
if(startButton != null && replayButton != null) replayButton.setPosition(getViewportWidth() - actionsStripWidget.getWidth() - startButton.getWidth() - replayButton.getWidth() - START_BUTTON_OFFSET_X * 2,
getViewportBottomY() + BOTTOM_OFFSET_Y);
actionsStripWidget.setBounds(getViewportWidth() - ACTIONS_PANEL_WIDTH, getViewportBottomY(), ACTIONS_PANEL_WIDTH, getViewportHeight());
......@@ -292,7 +292,13 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
}
private void createStartButton() {
startButton = new StandardTablexiaButton(getText(CrimeSceneAssets.DONE_TEXT));
startButton = new StandardTablexiaButton(getText(CrimeSceneAssets.DONE_TEXT)) {
@Override
protected void adjustBounds() {
super.adjustBounds();
setUpSizeAndPositionOfComponents();
}
};
startButton.setButtonSize(START_BUTTON_WIDTH, START_BUTTON_HEIGHT)
.setButtonPosition(getViewportWidth() - actionsStripWidget.getWidth() - START_BUTTON_WIDTH - START_BUTTON_OFFSET_X,
getViewportBottomY() + BOTTOM_OFFSET_Y)
......@@ -310,7 +316,13 @@ public class CrimeSceneGame extends AbstractTablexiaGame<CrimeSceneGameState> {
}
private void createReplayButton() {
replayButton = new StandardTablexiaButton("");
replayButton = new StandardTablexiaButton("") {
@Override
protected void adjustBounds() {
super.adjustBounds();
setUpSizeAndPositionOfComponents();
}
};
setUpReplayButtonText();
replayButton.setButtonSize(REPLAY_BUTTON_WIDTH, REPLAY_BUTTON_HEIGHT)
.setButtonPosition(getViewportWidth() - actionsStripWidget.getWidth() - START_BUTTON_WIDTH - REPLAY_BUTTON_WIDTH - START_BUTTON_OFFSET_X * 2,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment