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

How do I make a gui cover the whole screen on every device or screen size?

Asked by
gmod419 23
6 years ago

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?

4 answers

Log in to vote
0
Answered by
ax_gold 360 Moderation Voter
6 years ago
Edited 6 years ago

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.

0
Thanks, that helped but one more thing, how do I center it? I have a video at https://www.youtube.com/watch?v=7N8OiBwrk-I that will show you everything you need to know. gmod419 23 — 6y
0
If you look through the properties of textbuttons and other gui, there's a value called anchorpoint. Change that to (5,5) then change the position to (0.5,0,0.5,0). sorry for the late response, ax_gold 360 — 6y
Ad
Log in to vote
0
Answered by
imaski4 42
6 years ago

make size {1, 0}, {1, 0}

0
but the thing at the top where you toggle chat backpack and menu there is no gui there and its not centered. gmod419 23 — 6y
Log in to vote
0
Answered by 6 years ago

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

UDim2.new(1,0,1,0)
Log in to vote
0
Answered by 6 years ago

You can get the screen size with ViewportSize property from the Camera:

local plr = game.Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
local Frame = Instance.new("Frame")
wait (0.2)
screenGui.Parent = plr.PlayerGui
Frame.Position = UDim2.new(0,0,0,-36)
Frame.Size = UDim2.new(0,game.Workspace.Camera.ViewportSize.X,0,game.Workspace.Camera.ViewportSize.Y)
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.

Answer this question