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

How do you position a frame in the middle of the screen?

Asked by 9 years ago

It seems that using positions are a bad example of this, because they position the item not by the center, but by its sides. I want a frame in the middle of the screen, but I can't exactly find out why it won't do this. Is there a specific way to get this to work? I'm worried that it won't be positioned correctly on other devices ( since not everyone will have 1080p resolution ). Thanks!

1 answer

Log in to vote
0
Answered by 9 years ago

Hello,

You can do :

frame.Position = UDim2.new(.5-frame.Size.X.Scale/2,0,.5-frame.Size.Z.Scale/2,0)

TIP : If you ever want to center anything just do {0.5, -width/2, 0.5, -height/2}

0
i did not know that, ill have to note that down. thanks! killerjason1207 10 — 9y
Ad

Answer this question