diff --git a/RetroWindowsGUI/DesktopWindow.tscn b/RetroWindowsGUI/DesktopWindow.tscn index 4ab78a9..73aeebe 100644 --- a/RetroWindowsGUI/DesktopWindow.tscn +++ b/RetroWindowsGUI/DesktopWindow.tscn @@ -30,15 +30,7 @@ func getmosposi() -> Vector2i: func _input(event: InputEvent): if event is InputEventMouseButton: if event.button_index == MOUSE_BUTTON_LEFT: - if event.double_click: - if get_global_rect().has_point(get_global_mouse_position()): - window.toggle_maximized() - elif event.pressed: - if get_global_rect().has_point(get_global_mouse_position()): - dragging = true - begmosposi = getmosposi() - begwndpos = window.get_global_rect().position - elif event.is_released(): + if event.is_released(): dragging = false # snap within game window var rect = window.get_global_rect() @@ -50,6 +42,18 @@ func _input(event: InputEvent): elif event is InputEventMouseMotion: if dragging: window.global_position = begwndpos + getmosposi() - begmosposi + +func _gui_input(event: InputEvent): + if event is InputEventMouseButton: + if event.button_index == MOUSE_BUTTON_LEFT: + if event.double_click: + if get_global_rect().has_point(get_global_mouse_position()): + window.toggle_maximized() + elif event.pressed: + if get_global_rect().has_point(get_global_mouse_position()): + dragging = true + begmosposi = getmosposi() + begwndpos = window.get_global_rect().position " [sub_resource type="GDScript" id="GDScript_fvsxv"]