PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

StartDrag

StartDrag initiates a drag action using a dictionary of parameters. The parameters are as follows:

Name Type Default Description
Senderstring"" Identifies the source of the drag action to the drop target
MimeTypestring"text/plain" The MIME type of Data
DatastringRequired Information about the drag action (eg. what is being dragged). Should be used by the drop target.
MouseIconContent"" The icon to use for the mouse cursor during the drag. If empty, uses the default cursor.
DragIconContent"" An image to render under the mouse cursor during the drag. This should represent the item being dragged.
HotSpotVector2Vector2.new(0, 0) The pixel offset from the top-left where the cursor should "hold" the DragIcon.

See Also

  • articles/Drag and Drop in Studio Widgets
  • PluginGui/PluginDragEntered
  • PluginGui/PluginDragMoved
  • PluginGui/PluginDragDropped
  • PluginGui/PluginDragLeft

Parameters

Name Type Default Description

Returns

Return Type Summary

Code Samples


Plugin Drag and Drop

This code sample creates two plugin widget windows: a drag source and a drop target. In the source window, the script creates a TextBox and TextButton to allow the user to begin a plugin drag action. The drop target window will display the MimeType of whatever is dragged into it using a TextLabel. If the MimeType is text/plain, it will display the plain text data instead. Pictured below is an animation of the drag and drop action.

Screen recording of the drag and drop action in-Studio

To run this code sample as a plugin, paste it into a Script. Then, right-click the script in the Explorer window and choose “Save as Local Plugin”.