That doesn’t work. That works if the window is not being resized.
How did you determine that?
Edit: Thought you meant fullsize. I don’t want fullscreen but tried it anyways and it put the image in the top left of the screen, in fullscreen, because of the window resize code.
Instead of resizing manually via your own code, set the fullscreen flag (or resolution) in project settings and let the engine do it automatically at startup. You can runtime override project settings using override.cfg. It should work with exported projects as well. Look at ProjectSettings reference for details.
Alternatively you can just wait a bit until the splash is gone before resizing through your own code. Not too elegant but it’s at least a workaround. Or just don’t use the built in splash. Start with your own scene that acts as a splash.
Yeah, I got that.
Played around with this. On Windows I couldn’t reproduce it because the OS won’t let you grab or resize the window until the game is loaded.
I’m going to suggest you just use my Display plugin. You can just use it as an addon following the Readme instructions, or you can steal what you want from it. It has a test scene that loads up a default settings window. You can change the monitor and resolution, move the screen and see what happens when you restart the project. (The settings will save.)
Two caveats: The window always recenters itself when settings are changed. The Back button is intended to be used in a larger context and will throw an error.
A couple weeks ago I tried setting the ProjectSettings so that it would start up in the last position but I couldn’t get it working and left it for a later time.
I’m pretty much running into the same thing — I want the game to have an option for running in full screen vs windowed. Switching from my settings dialog works fine (DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)). I want the game to start in that mode the next time. I tried using the ProjectSettings API but that really didn’t seem to work (and worse, override.cfg exposes all my settings, not just the window mode).
My stopgap is to set the mode in an autoload, but I get a windowed splash screen in front of a full screen black, which is not what I expect.