I am not aware of such an event. This could be due to the fact that the
InputEventScreenDrag is defined as a completed action. You directly get information about relative vector and speed and this is only possible if the drag-event is done.
In practise this leads to multiple drag-events when you only seem to drag once. I am not sure how these are determined by the engine but you can see yourself by just print a statement each time your area receives an InputEventScreenDrag.
As a workaround I'm using the method
is_action_released in the input-event of the area. You only need to define a touch-InputEvent (same as leftmousebutton-click) and you can be sure that your drag is over when the click/touch is released.
I uploaded a sample project on zippyshare: dragger sample project
In the sample project there is one important thing: The released-method an the drag itself is registered in another Area2Ds input-event (the so called "drag-area"). This is due to the fact that a drag-event can not be detected beyond the borders of an area. So if your player has an Area2D which registered a touch-input the other area "is asked" if there was a drag-event. If so the player gets moved.
Here is the relevant code:
# We could work with groups and then adding entities to a 'touched' group
onready var player_touched = false
func _on_area_input_event( viewport, event, shape_idx ):
print("Touch on player pressed")
player_touched = true
func _on_drag_area_input_event( viewport, event, shape_idx ):
print("Touch on everything released")
player_touched = false
if event is InputEventScreenDrag:
print("Player gets dragged")
print("pos: ", event.position)
print("rel: ", event.relative)
print("vel: ", event.speed)
### Moving the player ###
# With collision
# Without collision
position = position + event.relative
PS: I am using Godot 3 beta1 and I am not sure if this works in Godot 2 because the structure of the InputEvents has changed.