Click or drag to resize

ControlCanDropData Method

Godot calls this method to test if data from a control's GetDragData(Vector2) can be dropped at position. position is local to this control.

This method should only be used to test the data. Process the data in DropData(Vector2, Object).

func can_drop_data(position, data):
    # Check position if it is relevant to you
    # Otherwise, just check data
    return typeof(data) == TYPE_DICTIONARY and data.has("expected")

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

Parameters

position
Type: GodotVector2

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

data
Type: SystemObject

[Missing <param name="data"/> documentation for "M:Godot.Control.CanDropData(Godot.Vector2,System.Object)"]

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Godot.Control.CanDropData(Godot.Vector2,System.Object)"]

See Also