DragDetector
Up and coming: shot check knows this class and its members today, and programs run it once the native runtime lands.
Up and coming
Drag things 1:1 with the pointer and throw them, report drags for splitters and sliders, or drag and drop between targets.
Put it under a UIObject: pressing that object and moving past Threshold starts a drag, so a click stays a click. Mode picks Move (the parent follows the pointer), Report (events only) or DragDrop (a ghost of the parent follows and each DropTarget lights up). The 1:1 follow and the throw happen without a round trip through your script on every mouse move.
Made with Instance.new("DragDetector") or Clone().
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| Enabled | boolean | ||
| Mode | "Move" | "Report" | "DragDrop" | Move: the parent follows the pointer 1:1; Report: events only, for splitters and sliders; DragDrop: a ghost of the parent follows and DropTargets light up. | |
| Axis | "XY" | "X" | "Y" | ||
| Throw | boolean | Move only: on release the parent keeps its speed and glides to a stop; any new press cancels the glide. | |
| Threshold | number | How far the pointer moves before a drag starts, 4 pixels by default, so a click stays a click. | |
| Tag | string | What DropTargets match against their Accepts list. | |
| Data | any | What a DropTarget receives when this is dropped on it. | |
| Dragging | boolean | read-only |
Events
| Name | Passes | Description |
|---|---|---|
| DragStarted | (Vector2) | Fires once the pointer has moved past Threshold, passing the position. |
| DragMoved | (Vector2, Vector2) | Passes the pointer's position and the delta. |
| DragEnded | (Vector2) | Fires on release, passing the velocity, not a position. |
From ShotInstance 33
ClassNameNameParentAncestryChangedAttributeChangedChangedChildAddedChildRemovedDestroyingAddTagClearAllChildrenCloneDestroyFindFirstAncestorFindFirstAncestorOfClassFindFirstAncestorWhichIsAFindFirstChildFindFirstChildOfClassFindFirstChildWhichIsAGetAttributeGetAttributeChangedSignalGetAttributesGetChildrenGetDescendantsGetFullNameGetPropertyChangedSignalGetTagsHasTagIsAIsAncestorOfIsDescendantOfRemoveTagSetAttribute
