im making a game where your on a computer and i need help making a movable and resize able ui
like the one in this video i made
i want it to stop at a certain size like in the video where it couldnt go smaller then that
and it couldnt go bigger then a certain size
and how you can only move the app around with the tab at the top
im still new to coding the best i can do was make the moving gui but i couldnt find a way to make the resize mechanism
local dragger = {};
local resizer = {};
do
local mouse = game:GetService("Players").LocalPlayer:GetMouse();
local inputService = game:GetService('UserInputService');
local heartbeat = game:GetService("RunService").Heartbeat;
-- // credits to Ririchi / Inori for this cute drag function :)
function dragger.new(frame)
local s, event = pcall(function()
return frame.MouseEnter
end)
if s then
frame.Active = true;
event:connect(function()
local input = frame.InputBegan:connect(function(key)
if key.UserInputType == Enum.UserInputType.MouseButton1 then
local objectPosition = Vector2.new(mouse.X - frame.AbsolutePosition.X, mouse.Y - frame.AbsolutePosition.Y);
while heartbeat:wait() and inputService:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) do
frame:TweenPosition(UDim2.new(0, mouse.X - objectPosition.X + (frame.Size.X.Offset * frame.AnchorPoint.X), 0, mouse.Y - objectPosition.Y + (frame.Size.Y.Offset * frame.AnchorPoint.Y)), 'Out', 'Quad', 0.1, true);
end
end
end)
local leave;
leave = frame.MouseLeave:connect(function()
input:disconnect();
leave:disconnect();
end)
end)
end
end
function resizer.new(p, s)
p:GetPropertyChangedSignal('AbsoluteSize'):connect(function()
s.Size = UDim2.new(s.Size.X.Scale, s.Size.X.Offset, s.Size.Y.Scale, p.AbsoluteSize.Y);
end)
end
end
script.Parent.Active = true
script.Parent.Draggable = true
this is the dragging/moving ui script
if you have any ideas just tell me
i can only get it to work with the entire frame and not a tab at the top
and i couldnt make a resize script