mirror of
https://github.com/jlengrand/korge-samples.git
synced 2026-03-10 08:31:18 +00:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user