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

How do you make a GUI fit any players screen? [Solved] [closed]

Asked by 10 years ago

I want to make it so that a GUI fits exactly the size of the players computer/laptop screen, but how do I do that?

Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

3 answers

Log in to vote
2
Answered by
jobro13 980 Moderation Voter
10 years ago

It depends on how you define "fits", I would define it as "there are no elements which fall outside the screen". You can easily do this by manipulating the Scale properties of UDim2s.

For instance, UDim2.new(1,0,1,0) is the complete screen if you would use it as Size. You probably don't want that. Let's say you want to create a GUI which uses the complete down right corner of the screen. (corner to the middle) You know that the Position property of the GUI is actually the pixel of the left top of the GUI.

In this case, you can also use the Scale property. You use the Position UDim2.new(0.5,0,0.5,0) (the middle of the screen) and the size UDim2.new(0.5,0,0.5,0) which is exactly a half of the screen in width and a half of the screen in height.

Try it out yourself!

Ad
Log in to vote
1
Answered by 10 years ago
GUI.Size = UDim2.new(1,0,1,0)

This uses the scale part of a UDim2. The scale can be anywhere between 0 and 1, and will be that fraction of its parent's size.

Log in to vote
0
Answered by
Freemium 110
10 years ago

I don't really understand your question so sorry if this doesn't help.

Normally in GUIs, the size property is set to something like {0, 100}, {0, 100}. In my experience, those seem to act as an exact measurement that will never change size (ex. it will take up 30% of the screen on one monitor while on a bigger one it'll take up 20%). So you want to change it to something like {1, 0}, {1, 0} which changes according to the density of the screen (like dpi in Eclipse when you make an app), I believe. Feel free to correct me if I'm wrong, I've just "learned" this by experimenting.

Now if you meant you want a GUI that covers the whole screen of any computer, I suggest changing the size property in your frame or whatever to {1, 0}, {1, 0}.