Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any other ways to make guis fit to different devices beside from scripting?

Asked by
TTHKKB 12
4 years ago

Hello! Is there any way to make guis fit different screens without scripting? Like a percentage scale or something. Also the position, please. Thank you so much!

0
If you spent about a minute or two and searched up base gui's and then found the position and then you see that there are variables in it that is scale instead of pixels firestarroblox123 440 — 4y
0
UIAspectRatio Ziffixture 6913 — 4y
0
Wow! Thank you so much! Sometimes I forgot to search youtube because most of the time it doesn't have the things I want. TTHKKB 12 — 4y

1 answer

Log in to vote
0
Answered by
lolzmac 207 Moderation Voter
4 years ago
Edited 4 years ago

Most GUIs have a size property that uses UDim2, which is composed of 4 values. xScale, xOfffset, yScale, and yOffset.

Offset is based on raw pixels, which means a screen that has different pixel counts on either dimension will look different compared to the screen you made the GUI on.

The percentage number you're looking for is scale. Scale (short for scalar) is based on the percentage of the screen that you want the GUI to take up. (0.5, 0, 0.5, 0) only uses scale and will take up half of the x dimension and half of the y dimension for the Roblox window.

Position also uses the same UDim2 values as size, so a GUI element placed at (0.5, 0, 0.5, 0) will render with its center (if the anchor point is at [0.5, 0.5]) at the exact center of the screen. It should be noted that the position its rendered at is also based on the anchor point of the object.

Ad

Answer this question