What did you do to fix the issue? I have just implemented the module and everything is working fine except for the release event which is triggered every time to GUI is moved rather then when released.
To add to the above, I have done more testing and it seems that any event I bind to is triggered by every event for every draggable object. That is to say, when the āStartedā event fires by one draggable object, every event connection receives a signal from the āStartedā, "Movedā and āReleasedā eventā¦ for every draggable object that exists.
I had 16 draggable objects created during this test. Each object was binded to the 3 events that should only exist for that specific object:
Is there something Iām missing here? Is this a problem with the Remote module? On that topic I am curious why the Remote module is even neededā¦ whatās wrong with just using Bindable events?
Switching out usage of the Remote module with BindableEvents has fixed the problem so Iām fairly confident there is some issue with the Remote module.
Hey, sorry for the slight bump, but every time I call :Destroy() on the draggable class, i get this error
hereās my code:
local CurrentDraggable
local function OpenUI()
Gui.Enabled = true
AppearTween:Play()
CurrentDraggable = DraggableUI.new(MainFrame)
CurrentDraggable:Ignore(IgnoreObjects) -- Allow the frame to be draggable
end
-- Main
-- Set ignored objects for UI
for i, Object in pairs(MainFrame:GetDescendants()) do
if Object:IsA("TextBox") or Object:IsA("GuiButton") or Object:IsA("ScrollingFrame") then
table.insert(IgnoreObjects, Object)
end
end
CloseButton.MouseButton1Click:Connect(function()
MainFrame.GroupTransparency = 1
Gui.Enabled = false
CurrentDraggable:Destroy()
end)
MainFrame.GroupTransparency = 1
OpenUI()
OpenUIEvent.OnClientEvent:Connect(function(GuiName)
if Gui.Name == GuiName then
OpenUI()
end
end)
Thank you so much for this, actual life saver.
Why is this not fixed yet? Can you update?
I just updated the module, but it is completely different. Some of the features that were in the previous module are no longer in the current module, but I do plan on adding them back in the future.
So I guess the new module doesnāt have off-screen limits?
Sorry, I did not bother adding it, because I was having a hard time just coming up a good function name for it.
Well I managed to implement it pretty easily so thereās no need for it now, but thanks for getting back!
Thanks for the update! I do wonder, does the frame go out of bounds if the X/Y size is increased? Does it take into account the AnchorPoint?
Iām not sure what you mean by which size is increased, but most of the calculations are done when the InputBegan
is called, such as the offset of the mouse to the GuiObject, and if there is a boundary, calculate the top left corner and the bottom right corner of the boundary.
While the InputChanged
is simply adding the offset and mouse position, if there is a boundary set, it clamps the new position from corner to corner.
And yes, it considers the AnchorPoint.
I likes this module but usually I prefer the all-in-one so if I have a frame draggable I would also add resizing frame would it be possible to integrate frame resizing with this module somehow? And would there be a problem with the main window if the player just resize their window application?
Was planning to makes this giant command prompt with console log be draggable and can resizing so it would makes the experience of not having something taken half the whole screen.
Implementing GuiObjectās resizing is definitely something Iāve considered. Maybe once I have the time I might actually implement it.
That depends on the current configuration. Currently, it uses UDim2.fromOffset
, but Iām planning to introduce an option to select fromScale
or fromOffset
, also an option for defining minimum scale or offset values.
Hey there! Been trying to figure the module out but for whatever reason I just canāt get it to dragā¦ Followed the documentation and all but it justā¦ Wonāt drag.
It does detect that the GUI has the draggable module bound to it, it just, wonāt really detect the draggingā¦
local Draggable = require(Modules.Draggable)
local Mainpanel = script.Parent.MainPanel
local DraggingUI = Draggable.new(Mainpanel)
print(DraggingUI.Enabled) --Prints out true
DraggingUI.Began:Connect(function() --Doesn't print anything...?
print("Dragging")
end)
(For further reference, hereās the UIās composition in explorer)
Got any idea as to why?
Make sure that the GuiObjectās Interactable is set to true:
yep, seems set true to meā¦ Still doesnāt work.
Is the MainPanel being obstructed by Background or any other GuiObject, if it is then I suggest to use the Include
method.
Yo, this is a really helpful module, but Iāve been wondering if thereās a way to make the draggable UI boundaries work on the right and bottom of the, well, boundaries?
For some reason, if I try to push the UI to the left or top of the UI I set as the boundary, the UI stops being dragged, but if I try to move it to the right or bottom, it just keeps moving