![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | WilliamD47 |
Hello, I am trying to make a draggable section of my app and am using this code
extends Control
var following = false
var start_pos = Vector2()
func _on_Titlebar_gui_input(event):
if event is InputEventMouseButton:
if event.get_button_index() == 1:
following = !following
start_pos = get_local_mouse_position()
if following:
OS.set_window_position(OS.window_position+get_local_mouse_position()-start_pos)
and when I run it, I have to double click the window section and then it crashes with Stack overflow 1024. If anyone could explain this, it would be greatly appreciated. Thanks!