Skip to content

UIDropTarget Class

Definition

Namespace: Brine2D.UI

A rectangular drop zone that participates in the canvas drag-and-drop system. Add it to a UICanvas and call RegisterDropTarget\(UIDropTarget\) to activate it. Subscribe to OnDrop to receive dropped payloads.

C#
public class UIDropTarget : Brine2D.UI.IUIComponent, Brine2D.UI.IAnchoredUIComponent

Inheritance System.Object → UIDropTarget

Implements IUIComponent, IAnchoredUIComponent

Properties
AcceptsPayload Optional predicate called by the canvas to decide whether this target accepts a given payload type. Return true to accept. Defaults to accepting all payloads when not set.
Anchor The screen anchor point this component is positioned relative to.
AnchorOffset Pixel offset from the resolved anchor point.
BorderColor Border color drawn around the zone. Set alpha to 0 to hide.
BorderThickness Border thickness in pixels.
HoverColor Background color rendered while a compatible drag payload is hovering over this zone.
IdleColor Normal background color. Use Transparent to make the zone invisible when idle.
IsHovered Whether a compatible drag payload is currently hovering over this zone. Set by UICanvas during drag updates.
Events
OnDrop Fired when a compatible payload is dropped onto this zone. The argument is the dropped IDragPayload.