Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

guis move randomly in game?

ok maybe this question isn't much about scripting, but my guis move when i join actual game. Here are the screenshots of roblox studio, and actual game:

roblox studio: http://prntscr.com/qxhk5t

actual game: http://prntscr.com/qxhkmw

is there any way to fix that? or am i doing something wrong :/ ?

3 comments

0

ok i just downloaded some gui rescaling plugin and i fixed it

0

When you resize your UI element use scale instead of offset...(1,0,1,0) -- The "1' is where the scale is and the "0" is the offset. When using scale offset must be set to 0 and the scale is usually from 0 to 1 depending on what you want to do. Learn more about those things in Youtube.

0

@bostaffmanbulgaria1 You can use a combination of scale and offset in UDim2

1 answer

GUI uses UDim2 which is much different then something such as Vector2. The first parameter is the fixed X value (in pixels), while the second parameter is a value that will be multiplied by the screen’s resolution to get the X value. Repeated with the Y as well. If both parameters have numbers then the end result will be added together. This will allow the GUI to scale correctly with different resolutions. In the following examples the screen’s resolution is 1024x768.

Ex.

{0, 0.5},{0, 0.5}

This will output a Vector2 of 512x384 with the given resolution

{100, 0.5},{200, 0.5}

This will output a Vector2 of 612x584 with the given resolution

1 comment

0

Wow, good explanation. Upvoted.

This discussion is preserved as it was. New answers, comments, and votes are closed.