Skip to content

UIDragDetector

Not yet Class GUI

Instance which facilitates and encourages interaction with UI elements in an experience.

Not implemented yet

This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.

0 Nova members · 35 modern Roblox members not implemented yet

Description

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.

Inheritance

Object → Instance → UIBase → UIComponent → UIDragDetector

Properties

Member Signature Summary
ActivatedCursorIcon ActivatedCursorIcon: ContentId Sets the cursor icon to display when the mouse is activated over the parent of this UIDragDetector.
ActivatedCursorIconContent ActivatedCursorIconContent: Content Sets the cursor icon to display when the mouse is activated over the parent of this UIDragDetector. Only supports asset URIs
BoundingBehavior BoundingBehavior: UIDragDetectorBoundingBehavior Determines bounding behavior of the dragged UI object when the detector's BoundingUI is set.
BoundingUI BoundingUI: GuiBase2d Instance whose bounding area defines the drag boundaries for the parent GuiObject.
CursorIcon CursorIcon: ContentId Sets the cursor icon to display when the mouse is hovered over the parent of this UIDragDetector.
CursorIconContent CursorIconContent: Content Sets the cursor icon to display when the mouse is hovered over the parent of this UIDragDetector. Only asset URIs are supported.
DragAxis DragAxis: Vector2 The drag axis for the UIDragDetector instance when DragStyle is set to [UIDragDetectorDragStyle.TranslateLine](../enu…
DragRelativity DragRelativity: UIDragDetectorDragRelativity Sets the paradigm which defines the relativity of inputs/outputs from a custom drag function.
DragRotation DragRotation: float The rotation performed by the current drag.
DragSpace DragSpace: UIDragDetectorDragSpace Sets the paradigm which defines the space of inputs/outputs from a custom drag function.
DragStyle DragStyle: UIDragDetectorDragStyle The paradigm used to generate proposed motion.
DragUDim2 DragUDim2: UDim2 The translation performed by the current drag expressed in a UDim2 value.
Enabled Enabled: bool Whether the UIDragDetector responds to user input.
MaxDragAngle MaxDragAngle: float Along with MinDragAngle, impedes the detector's attempts to generate rotational motion.
MaxDragTranslation MaxDragTranslation: UDim2 Along with MinDragTranslation, impedes the detector's attempts to generate linear/planar motion.
MinDragAngle MinDragAngle: float Along with MaxDragAngle, impedes the detector's attempts to generate rotational motion.
MinDragTranslation MinDragTranslation: UDim2 Along with MaxDragTranslation, impedes the detector's attempts to generate linear/planar motion.
ReferenceUIInstance ReferenceUIInstance: GuiObject A GuiObject instance whose local space and absolute center position is the reference space and origin for the detector.
ResponseStyle ResponseStyle: UIDragDetectorResponseStyle The paradigm used to define the response to proposed motion.
SelectionModeDragSpeed SelectionModeDragSpeed: UDim2 Maximum drag speed for translation.
SelectionModeRotateSpeed SelectionModeRotateSpeed: float Maximum angle per second the UIDragDetector can rotate at.
UIDragSpeedAxisMapping UIDragSpeedAxisMapping: UIDragSpeedAxisMapping UIDragSpeedAxisMapping value that determines the X/Y dimension dragging speeds.

Methods

Member Signature Summary
AddConstraintFunction UIDragDetector:AddConstraintFunction(priority: int, function: Function): RBXScriptConnection Adds a function to modify or constrain proposed motion.
GetReferencePosition UIDragDetector:GetReferencePosition(): UDim2 Returns the reference UDim2 position of the current drag's reference origin.
GetReferenceRotation UIDragDetector:GetReferenceRotation(): float Returns the reference rotation of the current drag's reference element.
SetDragStyleFunction UIDragDetector:SetDragStyleFunction(function: Function): null Passes a function to be used if and only if DragStyle is set to [UIDragDetectorDragStyle.Scriptable](../enums/UIDragDetectorDragStyle.md#s…

Events

Member Signature Summary
DragContinue DragContinue(inputPosition: Vector2) Fires when a user continues dragging the UI element after DragStart has been initiated.
DragEnd DragEnd(inputPosition: Vector2) Fires when a user stops dragging the UI element.
DragStart DragStart(inputPosition: Vector2) Fires when a user starts dragging the UI element.

Roblox reference: UIDragDetector

Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.