I have made a Gui and it works on my PC wonderfull but when I go play Roblox on my MacBook then the gui does not fit the screen, I can only see a little bit of it
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.
Please help.
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.
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.
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.
.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)