✓ Accepted answer
Hi, Dinoboshoff1. The problem of Not fitting in the Screen or Too big in the Screen is because of how you made your Gui Property. The properties of Scaling is what is happening
No clue on what I am talking about? Well, let's take a closer look
Gui (Graphic User Interface) in Roblox have a scaling property called Size which take in the values of UDim2. Size is pretty straight forward. It is width and the height of a Gui. You can do this manually by clicking on a Gui's property and setting the values. Now, the values are the UDim2 numbers. A UDim2 is Universal Dimension which has 2 Co-ordinates, the x-value and the y-value The x-value is the width of the Gui while the y-value is the height of the Gui.
####Since we got the basics cover, let's dig into your problem.
So on my PC where I made the Gui it works and fits, But when I go to my Macbook then it does not fit, So If you have a big screen you can see but, But if little then you cant.
The answer: Well this is because you are using the property of Offset in scaling.
Offset is a property of Size which takes in value from 0 to Infinite, although, infinite is unlikely to happen. The property of Offset is that, no matter what screen ration, the Gui Sized or Positioned in the Offset Value will stay on that position, no matter what ! It perfectly fits your problem. You are using an Offset Value to position your Gui, let's say 900. Since your screen is bigger, the offset value will remain the same there. Now when you are testing it out on your phone, your phone might not have screen size bigger than 500. Since you are using the property of Offset, the Gui still stays on 900 position of the phone screen. Which means, you will never see it.
The Solution: Scale
Luckily, Roblox has created a solution in which allows you to Size or Position a gui while maintaining the Device Screen Ratio. It is called Scale. Scale takes in value from 0-1. 1 here means the whole device screen while 0 means 0.
Here is an example of scaling a gui
The syntax for UDim2
.Position = UDim2.new(xScale, xOffset, yScale, yOffset)
.Size = UDim2.new(xScale, xOffset, yScale, yOffset)
local Frame = script.Parent
Frame.Position = UDim2.new(0.25, 0, 0.25, 0)
Frame.Size = UDim2.new(0.5, 0, 0.5, 0)
Hope you learnt new things from this tutorial. Comment below if it didn't fully help you or you have some other questions.
Have a lovely day of Coding!
2 comments
Well matters, if its like a character selection screen gui just stretch it out a bit more until on both pc and that mac you can see the whole gui.If its a little gui on the side of fhe screen the just change the X position so its more close to the middle.
But I cant there is something in the middle and something on the side and it does not fit on smaller screens