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

How can I make a gui fit every screen?

Asked by 6 years ago

Im not sure if this is scripting related but, how can I make a gui fit every screen? In games like Jailbreak and MM2, you can tell that their UI fits in every screen. When you rescale your screen, the ui gets smaller and still stays in the same position. How can I acheive this?

2 answers

Log in to vote
0
Answered by
RayCurse 1518 Moderation Voter
6 years ago

The size and position properties of gui elements are defined as values called UDim2 which stands for Universal Dimension. UDim2 values have four numbers. It has the x scale, x offset, y scale, and y offset. The x scale and y scale tells the percentage of the screen while the offsets tell the pixels. For example, the position UDim2.new(0.5 , 0 , 0.5 , 0) would be exactly at the center of the screen no matter the size because we defined it to be fifty percent across and fifty percent down.

The position UDim2.new(0 , 230 , 0 , 40) would be a position 230 pixels across and 40 pixels down. Because this is in pixels, it would position differently between different screens (different screens have different screen resolutions).

0
key point : anchorpoint needs to be 0.5, 0.5 abnotaddable 920 — 6y
Ad
Log in to vote
0
Answered by 6 years ago

You do not need a script, you just have to use the Scale of the size and position

Answer this question