Fix minesweeper board postion (#46)

Move the board to the center by setting x and y. The `centerOnStage()` didn't worked.
This commit is contained in:
Tobse
2021-05-26 21:05:55 +02:00
committed by GitHub
parent 2b8ead1851
commit 4ddc452303

View File

@@ -53,14 +53,8 @@ class Board(
}
//The board is centered on the screen
//x = screen.width / 2 - width / 2
//y = screen.height / 2 - (height - 10 - FONT_HEIGHT) / 2
//x = views.virtualWidthDouble / 2 - width / 2
//y = views.virtualHeightDouble / 2 - (height - 10 - FONT_HEIGHT) / 2
centerOnStage()
y += FONT_HEIGHT / 2
x = views.virtualWidthDouble / 2 - (width / 2)
y = views.virtualHeightDouble / 2 - (height - 10 - FONT_HEIGHT) / 2
// Restart board
restart()