centered buttons

This commit is contained in:
filux 2015-02-06 00:51:59 +01:00
parent 69e9dff754
commit edc9973725
3 changed files with 11 additions and 10 deletions

View File

@ -221,7 +221,7 @@ void Logger::renderLoadingScreen() {
metrics.getVirtualW() / 4, metrics.getVirtualW() / 4,
59 * metrics.getVirtualH() / 100, 59 * metrics.getVirtualH() / 100,
coreData.getDisplayFontSmall3D(), coreData.getDisplayFontSmall3D(),
350,""); // no string here, because it has to be language specific and does not give much information 500,""); // no string here, because it has to be language specific and does not give much information
} }
else { else {
renderer.renderProgressBar( renderer.renderProgressBar(
@ -229,7 +229,7 @@ void Logger::renderLoadingScreen() {
metrics.getVirtualW() / 4, metrics.getVirtualW() / 4,
59 * metrics.getVirtualH() / 100, 59 * metrics.getVirtualH() / 100,
coreData.getDisplayFontSmall(), coreData.getDisplayFontSmall(),
350,""); // no string here, because it has to be language specific and does not give much information 500,""); // no string here, because it has to be language specific and does not give much information
} }
} }
@ -300,7 +300,7 @@ void Logger::renderLoadingScreen() {
} }
//Show next Hint //Show next Hint
if(buttonNextHint.getEnabled() == false) { if(buttonNextHint.getEnabled() == false) {
buttonNextHint.init((metrics.getVirtualW() / 2) - (300 / 2), 90 * metrics.getVirtualH() / 100 + 20,175); buttonNextHint.init((metrics.getVirtualW() / 2) - (175 / 2), 90 * metrics.getVirtualH() / 100 + 20, 175);
buttonNextHint.setText(lang.getString("ShowNextHint","",true)); buttonNextHint.setText(lang.getString("ShowNextHint","",true));
buttonNextHint.setEnabled(true); buttonNextHint.setEnabled(true);
buttonNextHint.setVisible(true); buttonNextHint.setVisible(true);

View File

@ -50,7 +50,7 @@ MenuStateAbout::MenuStateAbout(Program *program, MainMenu *mainMenu) :
//init //init
buttonReturn.registerGraphicComponent(containerName, "buttonReturn"); buttonReturn.registerGraphicComponent(containerName, "buttonReturn");
buttonReturn.init(460, 100, 125); buttonReturn.init(438, 100, 125);
buttonReturn.setText(lang.getString("Return")); buttonReturn.setText(lang.getString("Return"));
labelAdditionalCredits.registerGraphicComponent(containerName, "labelAdditionalCredits"); labelAdditionalCredits.registerGraphicComponent(containerName, "labelAdditionalCredits");

View File

@ -41,24 +41,25 @@ MenuStateNewGame::MenuStateNewGame(Program *program, MainMenu *mainMenu):
Lang &lang= Lang::getInstance(); Lang &lang= Lang::getInstance();
int buttonWidth = 200; int buttonWidth = 200;
int buttonXPosition = (1000 - buttonWidth) / 2;
int yPos=465; int yPos=465;
buttonTutorial.registerGraphicComponent(containerName,"buttonTutorial"); buttonTutorial.registerGraphicComponent(containerName,"buttonTutorial");
buttonTutorial.init(425, yPos, buttonWidth); buttonTutorial.init(buttonXPosition, yPos, buttonWidth);
yPos-=40; yPos-=40;
buttonScenario.registerGraphicComponent(containerName,"buttonScenario"); buttonScenario.registerGraphicComponent(containerName,"buttonScenario");
buttonScenario.init(425, yPos, buttonWidth); buttonScenario.init(buttonXPosition, yPos, buttonWidth);
yPos-=40; yPos-=40;
buttonCustomGame.registerGraphicComponent(containerName,"buttonCustomGame"); buttonCustomGame.registerGraphicComponent(containerName,"buttonCustomGame");
buttonCustomGame.init(425, yPos, buttonWidth); buttonCustomGame.init(buttonXPosition, yPos, buttonWidth);
yPos-=40; yPos-=40;
buttonMasterserverGame.registerGraphicComponent(containerName,"buttonMasterserverGame"); buttonMasterserverGame.registerGraphicComponent(containerName,"buttonMasterserverGame");
buttonMasterserverGame.init(425, yPos, buttonWidth); buttonMasterserverGame.init(buttonXPosition, yPos, buttonWidth);
yPos-=40; yPos-=40;
buttonJoinGame.registerGraphicComponent(containerName,"buttonJoinGame"); buttonJoinGame.registerGraphicComponent(containerName,"buttonJoinGame");
buttonJoinGame.init(425, yPos, buttonWidth); buttonJoinGame.init(buttonXPosition, yPos, buttonWidth);
yPos-=40; yPos-=40;
buttonReturn.registerGraphicComponent(containerName,"buttonReturn"); buttonReturn.registerGraphicComponent(containerName,"buttonReturn");
buttonReturn.init(425, yPos, buttonWidth); buttonReturn.init(buttonXPosition, yPos, buttonWidth);
buttonCustomGame.setText(lang.getString("CustomGame")); buttonCustomGame.setText(lang.getString("CustomGame"));
buttonScenario.setText(lang.getString("Scenario")); buttonScenario.setText(lang.getString("Scenario"));