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

Difference with GUI scales?

Asked by 9 years ago

I have yet to learn the difference between the two values in position and scales of GUI's. Usually, I only use offset(0.5,0,0.1,0). <--- is it called offset?? Anyways, I only use offset to resize and position my GUIs. What is the second value used for, and whom do I use if I want my GUI to look the same on all screens?

1 answer

Log in to vote
0
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
9 years ago

Guis use a value called "UDim2", which means 2 dimentions, X and Y (ZIndex is the depth, like, what comes before what).

Using a UDim2 in a script will be; Position = UDim2.new(ScaleX, OffsetX ,ScaleY ,OffsetY )

All these things can be positive or negative, no matter how large!

However, "Scale", means the maximum height or width of the screen, depending on if you are useing the X or Y value.

The value "Offset" is the ammount of pixels, this will always be the same width, on every screen. no matter if its 10x10 meters, or 10x10 cm, it will always be the same. Scale will make it that its always filling up the same ammount of percentage of the screen, going from 0 to 1.

If you want any more information, i would suggest reading the roblox wiki about UDim2, and UDim. If that doesn't help, feel free to send me a msg on 'RubenKan' in roblox.

Hope this helps you any furder. Happy new year!

0
Thanks! This helped a lot! killerkill29 35 — 9y
Ad

Answer this question