Skip to content

Commit

Permalink
Get position of current screen to properly position window on multi-m…
Browse files Browse the repository at this point in the history
…onitor virtual desktop
  • Loading branch information
NotArme committed Nov 29, 2024
1 parent 5338bdf commit c09fee4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion splash_screen/splash_screen.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit c09fee4

Please sign in to comment.