UIDragDetector
The UIDragDetector instance facilitates and encourages interaction with 2D user interface elements in an experience, such as sliders and spinners. Key features include:
Place a UIDragDetector under any GuiObject instance to make it draggable via all inputs without a single line of code.
Choose from several DragStyle options, define how the object responds to motion via ResponseStyle, and optionally apply axis, movement limits, or drag boundaries.
Scripts can respond to manipulation of dragged objects to drive logic responses, such as adjusting settings.
UIDragDetectors work in Studio as long as you're not using the Select, Move, Scale, or Rotate tools, nor certain plugins or Studio's UI editor tools.
Summary
Properties
Sets the cursor icon to display when the mouse is activated over the parent of this UIDragDetector.
Determines bounding behavior of the dragged UI object when the detector's BoundingUI is set.
Instance whose bounding area defines the drag boundaries for the parent GuiObject.
Sets the cursor icon to display when the mouse is hovered over the parent of this UIDragDetector.
The drag axis for the UIDragDetector instance when DragStyle is set to Enum.UIDragDetectorDragStyle.TranslateLine.
Sets the paradigm which defines the relativity of inputs/outputs from a custom drag function.
The rotation performed by the current drag.
Sets the paradigm which defines the space of inputs/outputs from a custom drag function.
The paradigm used to generate proposed motion.
The translation performed by the current drag expressed in a UDim2 value.
Whether the UIDragDetector responds to user input.
Along with MinDragAngle, impedes the detector's attempts to generate rotational motion.
Along with MinDragTranslation, impedes the detector's attempts to generate linear/planar motion.
Along with MaxDragAngle, impedes the detector's attempts to generate rotational motion.
Along with MaxDragTranslation, impedes the detector's attempts to generate linear/planar motion.
A GuiObject instance whose local space and absolute center position is the reference space and origin for the detector.
The paradigm used to define the response to proposed motion.
Maximum drag speed for translation.
Maximum angle per second the UIDragDetector can rotate at.
Enum.UIDragSpeedAxisMapping value that determines the X/Y dimension dragging speeds.
Methods
Adds a function to modify or constrain proposed motion.
Returns the reference UDim2 position of the current drag's reference origin.
Returns the reference rotation of the current drag's reference element.
Passes a function to be used if and only if DragStyle is set to Enum.UIDragDetectorDragStyle.Scriptable.
Events
Fires when a user continues dragging the UI element after DragStart has been initiated.
Fires when a user stops dragging the UI element.
Fires when a user starts dragging the UI element.