From c09fee49b1c0b88b623c1521e9dd651193df1690 Mon Sep 17 00:00:00 2001 From: NotArme Date: Thu, 28 Nov 2024 23:14:16 -0300 Subject: [PATCH] Get position of current screen to properly position window on multi-monitor virtual desktop --- splash_screen/splash_screen.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/splash_screen/splash_screen.gd b/splash_screen/splash_screen.gd index b13722c6f..0b202f23e 100644 --- a/splash_screen/splash_screen.gd +++ b/splash_screen/splash_screen.gd @@ -61,7 +61,8 @@ func _enter_tree(): screen = randi() % BACKGROUNDS.size() set_screen(screen) var window : Window = get_window() - window.position = (DisplayServer.screen_get_size(window.current_screen)-Vector2i(size))/2 + var current_screen_index = window.current_screen + window.position = (DisplayServer.screen_get_size(current_screen_index)-Vector2i(size))/2 + DisplayServer.screen_get_position(current_screen_index) window.size = size func set_screen(bi : int) -> void: