Skip to content

Instantly share code, notes, and snippets.

@Werninator
Last active August 22, 2017 18:02
Show Gist options
  • Select an option

  • Save Werninator/79931aa5fe8a03e052f1387ee2136206 to your computer and use it in GitHub Desktop.

Select an option

Save Werninator/79931aa5fe8a03e052f1387ee2136206 to your computer and use it in GitHub Desktop.
Godot: centers the game window
# 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