Tested on Godot 2.0.4, Windows 10 64 bits:
When any Godot window opens (project manager, editor or games), it appears on the top-left of the screen, and if you happen to have your taskbar on top, the title bar appears under it.
There is a game window placement
parameter, but 1) it is in editor settings, 2) it's only for games, 3) it doesn't affects the exported game.
So I fixed this in my game by directly writing this script in auto-load to center the window, so it won't annoy players:
extends Node
func _ready():
# Center window on screen
var screen_size = OS.get_screen_size(OS.get_current_screen())
var window_size = OS.get_window_size()
var centered_pos = (screen_size - window_size) / 2
OS.set_window_position(centered_pos)
# Note: not tested on mobile platforms,
# should do nothing in that case because it's fullscreen anyway
The window still blinkes on the top-left when it opens, but at least it is repositionned after.
But the project manager and editor still have this issue.
I would suggest they appear at the center of the screen, like Unity3D does with its project manager.
This could be a common feature between tools and games, like, have an option for how the window should be placed when it is created on PCs. Because resolutions vary, it could be specified as an anchor or ratios.
In 2.1 the editor does start in the center of the screen. And so do exported games. However when you're in the editor and test a game, it is not centered, it still starts at the top left.
@CowThing in editor you can chose the game window placement in the Editor Settings.
Should we change the default value for the editor setting to "Center"?
I would expect the game to behave the same, exported or in editor, so it would mean the game window placement
is optional instead of being always used.
Since I haven't seen this on non-windows platforms, I think only windows with left or top toolbar has the issue. Not sure how much can be done about it, but would be nice if it is fixed.
This happens again in 3.0 master. The window spawns at the center of the screen, but as soon as the game starts rendering it jumps back to top-left, under the taskbar if any.
There is an editor option for this, but it makes the top-left corner centered, not the full window (so it spawns at the bottom right...). Also it only targets debugging, I'm not sure this will work for an exported game.
There is an editor option for this, but it makes the top-left corner centered, not the full window (so it spawns at the bottom right...). Also it only targets debugging, I'm not sure this will work for an exported game.
I can't reproduce that, it centers it will for me on Linux (current master).
Should we change the default value for the editor setting to "Center"?
This was fixed by 5f1603c.
Superseded by #9418.
Most helpful comment
Should we change the default value for the editor setting to "Center"?