Click or drag to resize

ControlGetDragData Method

Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns null if there is no data to drag. Controls that want to receive drop data should implement CanDropData(Vector2, Object) and DropData(Vector2, Object). position is local to this control. Drag may be forced with ForceDrag(Object, Control).

A preview that will follow the mouse that should represent the data can be set with SetDragPreview(Control). A good time to set the preview is in this method.

func get_drag_data(position):
    var mydata = make_data()
    set_drag_preview(make_preview(mydata))
    return mydata

Namespace:  Godot
Assembly:  GodotSharp (in GodotSharp.dll) Version: 1.0.0
Syntax
C#
public virtual Object GetDragData(
	Vector2 position
)

Parameters

position
Type: GodotVector2

[Missing <param name="position"/> documentation for "M:Godot.Control.GetDragData(Godot.Vector2)"]

Return Value

Type: Object

[Missing <returns> documentation for "M:Godot.Control.GetDragData(Godot.Vector2)"]

See Also