I want to detect a mouse click (and hold) inside an Area2D, and then detect the mouse release both inside or outside the Area2D.
Here's what I have so far:
extends Area2D #PickArea
func _input_event(viewport, event, shape_idx):
if event is InputEventMouseButton and event.button_index == BUTTON_LEFT:
if event.is_pressed():
print("picked")
else:
print("released") ## here be dragons. release only detected inside Area2D
The above works but it only detects the mouse release inside the Area2D. How do I detect the mouse release also outside the Area2D?
Here's the node structure: