How can I make my GUI's look the same on every platform?

I have a GUI in my game but on other platforms size and position is all messed up and I don’t know how to change that. Is there a plugin I could use or something?

3 Likes

Try using scale instead of offset for positioning and sizing. Scale is based on the percentage of the screen, but in decimal form. If you are unsure of what I mean, check out this article.

4 Likes

I’m not that good at scripting. How do I get the size of their screen and automatically re scale it?

1 Like

Scaling can be set without scripting. If you set the first and third numbers of the size property of a UI element (like {here, 0, here, 0}), that will automatically scale it based on the size of the screen. For example, {0.5, 0, 0.5, 0} will make the element be 50% the width and height of the user’s screen. {1, 0, 1, 0} will be the entire screen.

To answer your question, there is a way to get the size of a user’s screen by inserting this in a local script:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local sizeX, sizeY = mouse.ViewSizeX, mouse.ViewSizeY --returns the number in pixels of the user's screen width and height

However, I really do suggest using scale instead of having to go through the hassle of manually re scaling everything based on the size of the screen.

2 Likes

Setting the scale instead of offset will do that without the need of scripts, it’s built into the Roblox engine. When you set the Size property, instead of doing { 0, 256, 0, 256 } for example, you set it to { 1, 0, 1, 0 }.
This also applies to the Position property.

The first number is the X scale (width), which means how wide it’ll be compared to it’s parent. 1 = 100%, 0 = 0%, 0.5 = 50%, etc. The second number is the same on the Y axis (height).

3 Likes

Make them scale, so press the gui then look in properties then look at size then you’ll you see more button for the size, press that then press ctrl x the offset then paste it in scale and use this to make to processed faster.


and let me tell you how to use it so you press a gui the go in plugins then press scale.

3 Likes

this roblox GUI Plugin really good for fix the GUI size in your own games: www.roblox.com/library/2119567183

2 Likes

I recommend this plugin by @C_onfident:

3 Likes

You can calculate the scale by doing this formula.

GuiObject’s size in offset divided by actual screen size.

For example, my guiobject size in offset is 300x600 and the actual screen size is 1920x1080

I want the X axis to be in scale.

300/1920 = X Axis in scale

2 Likes