I have a GUI and I am using a tween to bring it onto the screen. I want my game to work on all devices but I have noticed that when I'm testing on my phone, half the GUI is off the screen. But on my PC, it is in the middle. I was just wondering if there is something that I can do to make it always be in the middle of the screen, whatever the device.
This is because of Offset
. This property is used to calculate how far out of line the GUI Instance should go in it's vertices. This doesn't work within the boundaries of the actual screen size, however. For actual relative screen position, we use Scale
. This is a ratio of the GUIs parent X-Y vertices, and it stands as a float from 0-1. If the GUI Instance happens to reside within a ScreenGui, it will give you the vertices of the user's monitor size,only if the GUI Instance is a direct child of it though, otherwise, for example let's say it was a child of a Frame Instance, it will inherit it's vertices.
To position it as centered, use .5
on each scale position property to have it be position half-and-half.