A GUI's position and size is represented using: (XScale, XOffset, YScale, YOffset)
If you want the GUI to be in the centre of the screen regardless of the screen size then you should use offsets.
If you had a Frame that had the size (0,500)(0,250), and you wanted that frame to be centred perfectly in the middle of a players screen, then you would have (0.5,-250)(0.5,-125) as the position of it.
You essentially half the offset value for each axis, make it a negative number and add 0.5 in the XScale and YScale values.
XScale and YScale both can change the appearance of a GUI depending on the size of the ROBLOX window on a player's client. You should only use XScale and YScale for size if you need a GUI to cover the whole player's screen. If you aren't, you should be using XOffset and YOffset which are basically pixels.
More examples of a centred GUI could be:
TextBox of size (0,50)(0,100), position would be (0.5,-25)(0.5,-50)
ImageLabel of size (0,700)(0,300), position would be (0.5,-350)(0.5,-150)
Finally, always remember that a GUI's position and size is measured from the top left corner of any GUI element.
3 comments
How do I do that?
I use the Gui Tweak plugin, http://www.roblox.com/GUI-Tweak-V1-1-item?id=144052484.
Thanks. Do you think {0.45, 0},{0, 0} would be the middle?