Last active
August 22, 2017 18:02
-
-
Save Werninator/79931aa5fe8a03e052f1387ee2136206 to your computer and use it in GitHub Desktop.
Godot: centers the game window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # https://godotengine.org/qa/485/how-to-center-game-window | |
| var screen_size = OS.get_screen_size() | |
| var window_size = OS.get_window_size() | |
| func _ready(): | |
| OS.set_window_position(screen_size * .5 - window_size * .5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment