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
Hello! My new resource DragUI can help with this!
The module features a way to allow bounded dragging via position or the bounds of your draggable element.
Check out the documentation and example code and try to produce your desired result, if you run into any issue or have any questions please reply on the resource’s thread and I will respond right away.
Hope this helps!
My apologies, here you go. If you need help PM me and I will respond asap.
Ohhh, this might be it! I’ll try it out, thank you!
UIDragDetector is expected to release sometime around the end of the month or early September, if you aren’t able to wait and need a project out immediately then use the resource I just sent.
Hey, @1DiamondBor, thanks for raising this issue! I appreciate you bringing it to my attention. I just released a fix that should take care of the issue. Now, the UI should respect the boundaries correctly when dragged in any direction.
Just wanted to let you know that because of my college commitments, I might not be as quick to respond but I will do my best to handle any more concerns or issues.
Also, there may not be many modifications to this module given the upcoming availability of UIDragDetector
. Still, I’m happy it was useful, and I’ll make sure any important matters are taken care of.