Hi there! So there was a problem with the old module, which was the Signal module that I personally made. There was also a problem with how the module was structured, and it can be hard to understand for anyone who wants to configure the module. Thus, I created a new module that is more efficient and can be easily read. For any one who still wishes to use the old module the link is here.
I love the module, and the fact to how it replaces the deprecated draggable property! Neat module, and very customisable.
One neat feature I’d love to request is perhaps: a function which enables whether the gui can go off screen or not. Meaning, automatically detect a player’s screen size, and prevent the UI being able to be dragged past those bounds to prevent UIs disappearing / being half hidden, etc.
This method restricts the dragging capability to the screen’s bounding box, which is the default. Passing in the first argument as true limits it to the parent’s bounding box. The second argument just allows you to force enable or disable the method.
Example
local DraggableUI = require(script.Parent.DraggableUI)
local InsideDraggableFrame = DraggableUI.new(script.Parent.Inside.Frame)
InsideDraggableFrame:LimitScreenBoundingBox(true)
local DraggableFrame = DraggableUI.new(script.Parent.Frame)
DraggableFrame:LimitScreenBoundingBox()
Update
The event handler now uses the signal module.
Other methods are not visible when using the module.
Other methods and indexes are not visible when creating a new draggable.
Oh, I found the issue; the issue was that the code was not considering the anchor point, which offsets the pivot of the GUI element based on the value of the anchor point. I just updated the module; let me know if there is still a bug, and I will try to fix it as soon as possible.
I’m using this module but it’s not working because whenever I move the mouse it fires Released instead of Moved, and for some reason it can’t find an object even though it’s clearly there
for i, v in pairs(slots) do
local dragObject = DraggableUIModule.new(v.TextButton)
v.TextButton.MouseButton1Click:Connect(function()
inventorySlotSelected(i, v, dragObject)
end)
v.TextButton.TouchTap:Connect(function()
inventorySlotSelected(i, v, dragObject)
end)
dragObject.Released:Connect(function(Position)
if isPositionInFrame(Position, INVENTORY_UI:FindFirstChild("Slots")) then
print("DROP!")
else
print("Dont Drop")
end
lastClickTick = tick()
v.TextButton.Position = UDim2.new(0,0,0,0)
print("Move Back")
end)
end
Most likely because it isn’t supported? Aren’t those mobile controls? Be more descriptive if you can, the OP is very good at adding & listening to suggestive features.