IN THIS ARTICLE
UIDropTargetComponent
UIDropTargetComponent
You can use a drop target component to make an element a target for drag-and-drop behavior.
UiDropTargetBus
Services messages for the UiDropTargetComponent
.
GetDropState
Returns the current drop state of the drop target component.
Syntax
eUiDropState GetDropState()
Following are possible values for eUiDropState
.
enum eUiDropState
{
eUiDropState_Normal,
eUiDropState_Valid,
eUiDropState_Invalid
};
GetOnDropAction
Returns the action triggered when a draggable component is dropped on this drop target.
Syntax
const AZStd::string& GetOnDropAction()
SetDropState
Sets the current drop state of the drop target component.
Syntax
Void SetDropState(eUiDropState dragState)
For possible values for eUiDropState
, see
GetDropState.
SetOnDropAction
Sets the action triggered when a draggable component is dropped on this drop target.
Syntax
void SetOnDropAction(const AZStd::string& actionName)
Tip
A more flexible way to be notified when a drop occurs is to use the
UiDropTargetNotificationBus.
UiDropTargetNotificationBus
Services notifications for the UiDropTargetComponent
.
OnDrop
Occurs when a draggable component is dropped on this drop target. The draggable component is passed in. Implement the game logic of what should happen on drag and drop here.
Syntax
void OnDrop(AZ::EntityId draggable)
OnDropHoverEnd
Occurs when the focus stops being on this drop target during dragging. The draggable component that is being dragged is passed into this function.
Syntax
void OnDropHoverEnd(AZ::EntityId draggable)
OnDropHoverStart
Occurs when the focus starts to be on this drop target during dragging. The draggable component that is being dragged is passed into this function.
Syntax
void OnDropHoverStart(AZ::EntityId draggable)