unreal.DragDropOperation

class unreal.DragDropOperation(outer: Object | None = None, name: Name | str = 'None')

Bases: Object

This class is the base drag drop operation for UMG, extend it to add additional data and add new functionality.

C++ Source:

  • Module: UMG

  • File: DragDropOperation.h

Editor Properties: (see get_editor_property/set_editor_property)

  • default_drag_visual (Widget): [Read-Write] The Drag Visual is the widget to display when dragging the item. Normally people create a new widget to represent the temporary drag.

  • offset (Vector2D): [Read-Write] A percentage offset (-1..+1) from the Pivot location, the percentage is of the desired size of the dragged visual.

  • on_drag_cancelled (OnDragDropMulticast): [Read-Write]

  • on_dragged (OnDragDropMulticast): [Read-Write]

  • on_drop (OnDragDropMulticast): [Read-Write]

  • payload (Object): [Read-Write] The payload of the drag operation. This can be any UObject that you want to pass along as dragged data. If you were building an inventory screen this would be the UObject representing the item being moved to another slot.

  • pivot (DragPivot): [Read-Write] Controls where the drag widget visual will appear when dragged relative to the pointer performing the drag operation.

  • tag (str): [Read-Write] A simple string tag you can optionally use to provide extra metadata about the operation.

property default_drag_visual: Widget

[Read-Only] The Drag Visual is the widget to display when dragging the item. Normally people create a new widget to represent the temporary drag.

Type:

(Widget)

drag_cancelled(pointer_event) None

Drag Cancelled

Parameters:

pointer_event (PointerEvent) –

dragged(pointer_event) None

Dragged

Parameters:

pointer_event (PointerEvent) –

drop(pointer_event) None

Drop

Parameters:

pointer_event (PointerEvent) –

property offset: Vector2D

[Read-Write] A percentage offset (-1..+1) from the Pivot location, the percentage is of the desired size of the dragged visual.

Type:

(Vector2D)

property on_drag_cancelled: OnDragDropMulticast

[Read-Write]

Type:

(OnDragDropMulticast)

property on_dragged: OnDragDropMulticast

[Read-Write]

Type:

(OnDragDropMulticast)

property on_drop: OnDragDropMulticast

[Read-Write]

Type:

(OnDragDropMulticast)

property payload: Object

[Read-Write] The payload of the drag operation. This can be any UObject that you want to pass along as dragged data. If you were building an inventory screen this would be the UObject representing the item being moved to another slot.

Type:

(Object)

property pivot: DragPivot

[Read-Write] Controls where the drag widget visual will appear when dragged relative to the pointer performing the drag operation.

Type:

(DragPivot)

property tag: str

[Read-Write] A simple string tag you can optionally use to provide extra metadata about the operation.

Type:

(str)