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

How to ensure that GUI's position is the same for everyone ?

Asked by 5 years ago

I've made a frame (in a screen gui) that is supposed to appear at the bottom of the screen. However, what if someone have a taller screen than mine ? Does the GUI appears at the bottom or a little bit more up ? Is there a way to fix it ?

Here's some properties of the frame : Position : {0, 0},{0.939, 0} Size : {0, 727},{0, 25}

Screen gui absolute size : 727, 427

1 answer

Log in to vote
2
Answered by 5 years ago

Ello! To make this short and sweet. You are using Offsets!

Offsets are the amount of pixels a gui is sized/positioned, Offsets are a useful value to use, dont get me wrong, but for your purpose i would set the size to use scale. How to do that?

{0,727},{0,25} ^ This zero is a scaleX value, meaning a percentage of the screen will be scaled via the X axis.

{0,727},{0,25} ^ This is the OffsetX value, meaning you are scaling the object on the X axis via pixels. This is a great way to size guis, if you want them to be the same size on all screens. but also makes positioning them harder, as screens can be different sizes.

{0,727},{0,25} ^ ^ These two are simular in terms of above, only for the Y axis. Up-down.

So, to fix your problem, you'd size it via scale. Or you can do math calculations in a script, or set the anchor point.

Here's how to scale it accordingly

{1,0},{.051,0} Im assuming you are scaling the gui via the x axis to cover the whole screen. After doing this it shouldn't seem like its doing much, but now its using percentages of the screen to fill, no matter the user's screen size.

If you want it placed on the bottom, but still use Offset, then you can do some basic stuff. like.

set position to

{0, 0},{1, -25} this says to move the element 100% down, and subtract 25 pixels from the postion. Because your element's size is 25 pixels on the y axis.

0
Thanks you so much ! It's very helpful NotZuraax 68 — 5y
Ad

Answer this question