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

GUI And overall resolution. How to get GUIs to scale perfectly on all resolutions?

Asked by 6 years ago
Edited 6 years ago

Hi, so my question is how could i make an static resolution for my GUI or even anything? I see that some games have the static resolution for example if you are on fullscreen, then you can see all the GUIS perfectly, and also when you are playing windowed or smaller screen then you can see GUIS perfectly too. But my game doesnt have that function, if i make my game small windowed screen, then i cant see my shop GUI for example. How to get GUIS to scale perfectly on all resolutions basically?

0
This is off-topic. Post on-topic questions. User#19524 175 — 6y
0
Pretty sure this is what you are looking for: https://wiki.roblox.com/index.php?title=API:Class/UISizeConstraint lunatic5 409 — 6y
0
In the position and size, change the scale value to 1: {1, 0, 1, 0} (doesn't really matter what number). Then you can resize and reposition the gui by clicking and dragging it (same way you position and resize blocks) hellmatic 1523 — 6y
0
It should automatically adjust the scale (no numbers should be in the offset). hellmatic 1523 — 6y

1 answer

Log in to vote
0
Answered by
valchip 789 Moderation Voter
6 years ago
Edited 6 years ago

Ever wondered why a 2D Gui has 4 digits({0, 0}, {0, 0}) to put in? Why not 2(X, Y)? I have the answer to that. Let me explain you why there are 4 instead of 2. So X and Y (both of them) have something called Scale and Offset. This is how a normal Size or Position setting would look like: {0,0},{0,0}. So basicly there are are 4 digits because X is compose of scale and offset, same thing with Y. Offset is in the right, scale in the left. (X){scale, offset}, (Y){scale, offset}. So let me take an example: if you set the scale of a frame to {0.5, 0}, {1, 0}, that will be the half of the screen, no matter what device. So it will be the same size for every device, so it will always be the half. But, if you use offset, it would be that amount of pixel for only that device. This might sound confusing, I apologize I am not a very good teacher. I made a GIF which may help you understand this: https://gyazo.com/adba01315990da0d6282c2adfe4839e8

I am not saying you should only use Scale, you should use both. Just play around with them and you will understand what I mean.

0
¯\_(?)_/¯ User#19524 175 — 6y
0
So i need to use scale? Or offset which one you recommend? MarkusMape 22 — 6y
0
scale... duh wookey12 174 — 6y
0
^ as I said you should use both, depends on the case, I gave you an example of size, but same thing will happen with the position. So you should combine both of them. Depends on what you want too! valchip 789 — 6y
View all comments (3 more)
0
although it will never look perfect. for example, if you have a 20 inch monitor, but then it's scaled down to a smartphone. wookey12 174 — 6y
0
Sorry if my explaination was not that good but I haven't seen any good tutorial with a good explaination. The way I understood this all was from a GIF someone sent me a GIF which is almost identical to the one I sent you. Then I understood what was the difference and how they should be used. valchip 789 — 6y
0
Yes, i understand now that. But now the thing is i dont know how to use the scale. MarkusMape 22 — 6y
Ad

Answer this question