Adaptation to be able to play on android
This commit is contained in:
@@ -118,22 +118,15 @@ void SimpleChooseLevelScreen::setupPositions()
|
||||
bGamemode->x = centerX - totalButtonWidth / 2;
|
||||
bCheats->x = bGamemode->x + buttonWidth + buttonSpacing;
|
||||
|
||||
// compute vertical centre for buttons in remaining space
|
||||
{
|
||||
int bottomPad = 20;
|
||||
int availTop = buttonHeight + 20 + 30 + 10; // just below seed
|
||||
int availBottom = height - bottomPad - bCreate->height - 10; // leave some gap before create
|
||||
int availHeight = availBottom - availTop;
|
||||
if (availHeight < 0) availHeight = 0;
|
||||
int y = availTop + (availHeight - bGamemode->height) / 2;
|
||||
bGamemode->y = y;
|
||||
bCheats->y = y;
|
||||
}
|
||||
// position Survival/Cheats buttons below the seed field
|
||||
int buttonY = tSeed.y + tSeed.height + 20;
|
||||
bGamemode->y = buttonY;
|
||||
bCheats->y = buttonY;
|
||||
|
||||
// position Create button just below with a small gap
|
||||
bCreate->width = 100;
|
||||
bCreate->x = centerX - bCreate->width / 2;
|
||||
int bottomPadding = 20;
|
||||
bCreate->y = height - bottomPadding - bCreate->height;
|
||||
bCreate->y = buttonY + bGamemode->height + 40;
|
||||
}
|
||||
|
||||
void SimpleChooseLevelScreen::tick()
|
||||
|
||||
Reference in New Issue
Block a user