so I'm making a loading gui and I have everything sorted out. Besides the size of the gui. I want it to cover the whole screen on every screen size. How I do dis?
Change the size to (1,0,1,36)
and the position to (0,0,0,-36)
. That should make it cover the whole screen. If it doesn't, let me know.
make size {1, 0}, {1, 0}
Instead of having to put in the position as (0,<Number> 0, <Number>) that will make it so the position can't cover everything but if you do: (<Number>,0, <Number>, 0) it will cover the entire screen
1 | UDim 2. new( 1 , 0 , 1 , 0 ) |
You can get the screen size with ViewportSize
property from the Camera
:
1 | local plr = game.Players.LocalPlayer |
2 | local screenGui = Instance.new( "ScreenGui" ) |
3 | local Frame = Instance.new( "Frame" ) |
4 | wait ( 0.2 ) |
5 | screenGui.Parent = plr.PlayerGui |
6 | Frame.Position = UDim 2. new( 0 , 0 , 0 ,- 36 ) |
7 | Frame.Size = UDim 2. new( 0 ,game.Workspace.Camera.ViewportSize.X, 0 ,game.Workspace.Camera.ViewportSize.Y) |
8 | Frame.Parent = screenGui |
I positioned the Frame 36 pixels higher to make it go under the bar on the top of the screen, feel free to completely remove the positioning.