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

Hello all, I have made an Gui problem , Please helpp?

Asked by 6 years ago

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.

0
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. tonicos33 6 — 6y
0
But I cant there is something in the middle and something on the side and it does not fit on smaller screens Dinoboshoff1 -17 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 years ago

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!
0
Hello , I Know what you Mean , But you can add it I do not Know How. Dinoboshoff1 -17 — 6y
0
what do you mean by that? Axceed_Xlr 380 — 6y
Ad

Answer this question