unreal.DragDropOperation

class unreal.DragDropOperation(outer: Optional[Object] = None, name: Union[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] Default Drag Visual: 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] Offset: 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 Drag Cancelled

  • on_dragged (OnDragDropMulticast): [Read-Write] On Dragged

  • on_drop (OnDragDropMulticast): [Read-Write] On Drop

  • payload (Object): [Read-Write] Payload: 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] Pivot: Controls where the drag widget visual will appear when dragged relative to the pointer performing the drag operation.

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

property default_drag_visual: Widget

[Read-Only] Default Drag Visual: 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] Offset: 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] On Drag Cancelled

Type:

(OnDragDropMulticast)

property on_dragged: OnDragDropMulticast

[Read-Write] On Dragged

Type:

(OnDragDropMulticast)

property on_drop: OnDragDropMulticast

[Read-Write] On Drop

Type:

(OnDragDropMulticast)

property payload: Object

[Read-Write] Payload: 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] Pivot: 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] Tag: A simple string tag you can optionally use to provide extra metadata about the operation.

Type:

(str)