ULimenDraggableWidget
Overview
ULimenDraggableWidget is a subclass of UWidget designed to provide drag functionality. It supports two types: a brush and a custom user widget. The widget's appearance and behavior are configurable through properties such as WidgetType, CustomWidget, and WidgetBrush.
Properties
Type | Name | Access | Description |
|---|---|---|---|
| WidgetType | EditAnywhere | Determines whether the widget is a brush or a custom user widget. |
| CustomWidget | EditAnywhere | The custom user widget class to be instantiated when |
| WidgetBrush | EditAnywhere | The brush to display when |
| HorizontalAlignment | EditAnywhere | The horizontal alignment of the widget. |
| VerticalAlignment | EditAnywhere | The vertical alignment of the widget. |
Functions
Return Type | Signature | Description |
|---|---|---|
| RebuildWidget() | Constructs and returns the Slate widget for this UMG widget. |
| ReleaseSlateResources(const bool bReleaseChildren) | Releases any resources used by the Slate widget. |
| MouseDown(const FGeometry& InGeometry, const FPointerEvent& MouseEvent) | Handles mouse down events to capture and start dragging. |
| MouseUp(const FGeometry& InGeometry, const FPointerEvent& MouseEvent) | Handles mouse up events to release the mouse capture. |
| MouseMove(const FGeometry& InGeometry, const FPointerEvent& MouseEvent) | Handles mouse move events to update the widget's position during dragging. |
Usage & Implementation Notes
The widget uses a
SMouseDetectorfor detecting and handling mouse events.When
WidgetTypeis set toCustomWidget, an instance of the specified custom user widget is created and displayed.The widget's position can be updated by capturing mouse movement and adjusting its render translation.