I've implemented drag-and-drop using this tutorial:
https://generalistprogrammer.com/godot/godot-drag-and-drop-tutorial/
In my code, when the user drags a sprite, there are one or more "boxes" that they can drop the sprite into -- these boxes are Area2D's
When dragging, if the user hovers over one of the Area2D's I have a selection frame that appears around the Area2D which indicates which Area2D is going to be the target of the drag/drop. So the Area2D's have a mouse entered/exited signal for showing the selection frame (which is just a sprite).
Next I wanted to use a TextureRect instead of a Sprite as the source of the drag/drop. So I thought I could do that by getting the mouse down event on the TextureRect and when starting the drag, instantiate a Sprite and have the Sprite move with the mouse to the Area2D target. This part works fine, however, the Area2D no longer gets a mouse entered signal during the drag.
As a simple example, I created a new project in Godot, added an Area2D/CollisionShape/Sprite and attached these signals:
func _on_Area2D_mouse_entered():
print("mouse entered")
func _on_Area2D_input_event(viewport, event, shape_idx):
if event is InputEventMouse:
print("mouse event")
Then I added a TextureRect and launched the scene. If I mouse down on the TextureRect and then move the mouse across to the Area2D, I will not see any mouse events signal on the Area2D -- not until I let go of the mouse. If I set the TextureRect's Mouse Filter property to Ignore, then I will get the events on the Area2D, but I won't know when the user has mouse down'd on the TextureRect to start the drag/drop operation.
The reason why I started using TextureRect is because I need to have a list of sprites in a scrollable container that the user and drag from. I don't know of a way to have a scrollable list of Area2D's. I hope there is a workaround. Help is greatly appreciated!