How to scale and position UI based on screen size

Im having a problem with scaling and positioning UI. I have been looking for the solution to my problem on youtube and devfourm, but I cant find any solutions. I did find a plugin but I want to learn how to scale and position UI with scripts.

How would I go about scaling and positioning UI with a script? Please explain how it works also.

1 Like

I use plugins to make the UI on scale so it auto scales on every device maybe you can get the source code from the plugin and learn that way? You can do that with this game:GetService(“InsertService”):LoadAsset(ID,true).Parent = workspace
in the ID put the ID of the plugin

This has been explained in the devforum a couple of times and doesn’t require to be explained again, see here: How to scale or position same on all devices - #12 by Alexander_Ashford

Hello @YouMaddddddmonkey Unlike @Winbloo Here’ s a Mini Tutorial.

Without Using Plugin Do The Following:

  1. Create youre GUI.
  2. Place it however you want
  3. In the properties Make sure to Put Offset to 0 (Positizion and size)

Now you can see it perfectly in all devices!

If You want to use a plugin You can use this:

  1. Create You’re GUI
  2. Select All You’re GUI that you create
  3. Open The Plugin for the plugin tab.
  4. Click the Button Size In Positizione and size

Now you’re GUI is perfectly in all devices!

if you found this answer helpful, mark it as a Solution!

2 Likes

Don’t forget to set the scale.

Ehh, not quite yet, you need a UIAspectConstraint in the children of the UI so they scale accordingly with the parent. (Make sure AspectType is ScaleWithParentSize) - UIAspectRatioConstraint | Roblox Creator Documentation

1 Like

As already written, this is a Mini Tutoral that shows the basics to scale the UI in all devices,
By following the tutorial I made, you can do it without any problems.

it is obvious that there are many other tools to make them even more perfect.

Don’t forget to set the scale.

By Setting the Size and Position offset to 0, the gui is perfect in all devices.

Currently, I use This Plugin In Huge Game And I Never Have Trouble Scaling GUI without using UIAspectConstraint or others things.
If desired, it can be added but it is not mandatory.

Also, If You Want It By Downloading the plugin I linked, you can insert it in all you’re GUI that you select

1 Like