diff --git a/scenes/window/draggable.gd b/scenes/window/draggable.gd index d19f356..6efec7f 100644 --- a/scenes/window/draggable.gd +++ b/scenes/window/draggable.gd @@ -12,6 +12,11 @@ func _ready() -> void: set_process_input(true) +func initial_drag(): + dragging_start_position = get_global_mouse_position() + dragging = true + + func _input(event) -> void: if event is not InputEventMouseButton: return diff --git a/scenes/window/dragon.gd b/scenes/window/dragon.gd index bd06503..b9ff932 100644 --- a/scenes/window/dragon.gd +++ b/scenes/window/dragon.gd @@ -20,7 +20,7 @@ func on_place_back() -> void: func _ready() -> void: - _pick_random_screen_position() + draggable.initial_drag() func _process(delta: float) -> void: