UIDragDetector

Show Deprecated

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

Methods

Events

Properties

ActivatedCursorIcon

ContentId
Read Parallel
Read Parallel

BoundingUI

Read Parallel

CursorIcon

ContentId
Read Parallel

DragAxis

Read Parallel
Read Parallel

DragRotation

Read Parallel
Read Parallel
Read Parallel

DragUDim2

Read Parallel

Enabled

Read Parallel

MaxDragAngle

Read Parallel

MaxDragTranslation

Read Parallel

MinDragAngle

Read Parallel

MinDragTranslation

Read Parallel

ReferenceUIInstance

Read Parallel
Read Parallel

SelectionModeDragSpeed

Read Parallel

SelectionModeRotateSpeed

Read Parallel

UIDragSpeedAxisMapping

Read Parallel

Methods

AddConstraintFunction

Parameters

priority: number
function: function

Returns

GetReferencePosition


Returns

GetReferenceRotation


Returns

SetDragStyleFunction

()

Parameters

function: function

Returns

()

Events

DragContinue

Parameters

inputPosition: Vector2

DragEnd

Parameters

inputPosition: Vector2

DragStart

Parameters

inputPosition: Vector2