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

Why is my Gui the correct size in studio but not in game?

Asked by 5 years ago

My loading Gui is too small in game but not in studio. Here's a gyazo gif of it: Game

Studio Hope someone could tell me if there is a way to fix it.

1 answer

Log in to vote
0
Answered by 5 years ago

Study UDim2 parameters later. There are two types of scaling in UDim2:

  1. Scalars
  2. Pixels

UDim2.new(x, x, y, y) UDim2.new(1,2,1,2) UDim2.new(xScalar, xPixel, yScalar, yPixel)

As the name suggests, each pixel takes up a Pixel on the screen. For example, a "1 x 1" pixel would have one pixel in width, and one pixel in height.

A scalar would be relative to the size of your screen or its parent GUI. Example, a "1 x 1" scale would be 100% of your width, and 100% of your height. Covering your entire screen.

In other words, you used pixels to fill the size of your studio screen, not the actual screen itself.

SOLUTION: Simply put, UDim2.new(1,0,1,0) for your GUI cover. For the elements inside of the cover, you will have to play around with it. Generally, if you want the element to be in the center, it will be: UDim2.new(0.5, xSize/2, 0.5, ySize/2)

Ad

Answer this question