Size: {0.2, 0},{0.2, 0} Position: {0.4, 0},{0.4, 0}
The center of a frame (e.g. the screen) is always {0.5, 0}, {0.5, 0}
-- since 50% across vertically/horizontally is the middle.
The .Position
of a GUI is always its top-left-corner.
The .Size
o fa GUI is always the amount across from the left to the right and the top to the bottom. So half way through the GUI is .Size / 2
A GUI is centered in the view if its center is the same as the containing frame's center. Meaning that {0.5, 0} {0.5, 0}
=
.Position
+``.Size / 2
If you want to figure out the position for a given size, then it's just this, through basic algebra:
Position
=
{0.5, 0} {0.5, 0}
-
Size / 2
So, for a size (0.2, 0, 0.2, 0) object, you need (0.5, 0, 0.5, 0) - (0.2, 0, 0.2, 0) /2 = (0.5 - 0.1, 0, 0.5 - 0.1, 0) = (0.4, 0, 0.4, 0)