Making UI scalable

There’s probably a simple answer to this, but I don’t know exactly what to do here.
Let’s say I’m working on a custom chat. I want this chat to be as convenient to the players as possible, so I add an option to scale the chat as big or as small as it can go, using a dragger. Here’s an example if you don’t know what I mean:

Here there’s a clear answer. Just make the UI element draggable then calculate the size of the frame, simple and effective. Unfortunately, I can’t do that in this case as my UI uses an AspectRatioConstraint, meaning the player could drag the icon outside of the chat. This is what it looks like:

This is an example of what I want it to do:

Any help is appreciated! Thanks!

1 Like

Try to enable WindowResizable on chat module
local chatmodule=require(game.Chat:WaitForChild("ClientChatModules"):WaitForChild("ChatSettings")) chatmodule.WindowResizable = true

1 Like

You can use @AbDotPng 's method, which does work, but you can also use a plugin I made for chat customizing if you would like (its free).

https://www.roblox.com/library/5945550758/Smart-Chat-Customization

1 Like

Both of these would work, but when I said custom chat, I didn’t mean modification of the modules. This is all being made from scratch.

The point here isn’t the chat at all, it was just my example of it and the easiest to explain.

2 Likes

Like this?

The dragger should be a ui object inside of the main chat frame

local mouse = game.Players.LocalPlayer:GetMouse()


local Dragger = script.Parent

local Holder = Dragger.Parent

Isdown = false

MouseEntered = false

Dragger.MouseEnter:Connect(function()
	MouseEntered = true
	
end)

Dragger.MouseLeave:Connect(function()
	mouse.Button1Up:Wait()
	MouseEntered = false
end)
mouse.Button1Down:Connect(function()
	Isdown = true

end)

mouse.Button1Up:Connect(function()
	Isdown = false
end)


while true do
	if Isdown  and MouseEntered then
		Dragger.Position = UDim2.fromOffset(mouse.X, mouse.Y)

		Holder.Size = Dragger.Position

	end
	wait()
end

Hope this helps :slight_smile:

2 Likes

Unfortunately, that’s not quite what I was looking for. Because my UI has an AspectRatioConstraint, this method would not work. I simply cannot use a draggable element here.