{"id":"vorlias/snapdragon","name":"snapdragon","scope":"vorlias","platform":"roblox","description":"Dragging library with snapping capabilities for Roblox UI","version":"2.0.0","latest":"2.0.0","versions":["2.0.0"],"license":"MIT","licenseRating":"safe","licenseCaveats":["The package archive does not include its license text; the license is declared in its manifest metadata."],"licenseVerified":false,"dependencies":{},"integrity":"b4db8c7fa5d9fe33dec03ea05817969a9ed435f69e5503f7b03ccc89c9ea3172","likes":0,"downloads":0,"install":"forest install vorlias/snapdragon","url":"https://forest.dev/p/roblox/vorlias/snapdragon","files":"https://api.forest.dev/ai/package/roblox/vorlias/snapdragon/files","readme":"<div align=\"center\">\r\n\t<img src=\"https://assets.vorlias.com/i1/snapdragon.png\"/>\r\n\r\n\r\n</div>\r\n<div align=\"center\">\r\n  \t<h1>Snapdragon</h1>\r\n\t<a href=\"https://www.npmjs.com/package/@rbxts/snapdragon\">\r\n\t\t<img src=\"https://badge.fury.io/js/%40rbxts%2Fsnapdragon.svg\"></img>\r\n\t</a>\r\n</div>\r\n\r\nLibrary for UI dragging support, with snapping capabilities in Roblox.\r\n\r\nDocumentation for Snapdragon can be found at https://roblox-aurora.github.io/rbx-snapdragon\r\n\r\n\r\n# Basic Usage\r\n```ts\r\n// Typescript\r\nimport { createDragController } from \"@rbxts/snapdragon\";\r\nconst controller = createDragController(gui, {SnapEnabled: true});\r\ncontroller.Connect() // Attaches the controller to the gui you specify\r\n\r\ncontroller.Disconnect() // Will disconnect the drag controller from the Gui\r\n```\r\n\r\n```lua\r\n-- Lua\r\nlocal Snapdragon = require(snapdragonModule)\r\nlocal controller = Snapdragon.createDragController(gui, {SnapEnabled = true})\r\ncontroller:Connect() -- Attaches the controller to the gui you specify\r\n\r\ncontroller:Disconnect() -- Will disconnect the drag controller from the Gui\r\n```\r\n\r\n## Usage with Roact\r\nIf you want to use Snapdragon with Roact, simply use `Roact.Ref` with the object you want to be draggable, and create and assign a controller in the `didMount` method to the ref's instance.\r\n\r\n# FAQ\r\n## Why not just use `GuiObject.Draggable`?\r\n`Draggable` is deprecated. It never worked well and isn't flexible - as discussed [here](https://devforum.roblox.com/t/draggable-property-is-hidden-on-gui-objects/107689/5?u=vorlias).\r\n\r\nThis library aims to add the ability to make your UI draggable without the extra work on your part, as well as make it more flexible with snapping capabilities and constraints (soon&trade;)\r\n\r\n## What about controller support?\r\nI would like to add the ability for controllers to drag UI elements at some point. Some console games actually have a faux-mouse type dragging system, it would function in a similar fashion.\r\n\r\n# API\r\nThe API for Snapdragon can be found [here](index.d.ts)\r\n\r\nThere will eventually&trade; be proper docs for this library.\r\n","readmeTruncated":false}