I’m not sure if this is supposed to be in scripting support, if its not my bad.
So, I saw a few tutorials about using a plug in to make a GUI fit in every device, but non of the methods work for me. Can someone tell me an efficient way to this?
I won’t mind if you tell me how to use the plugin*
GUI objects sizes are UDim2. They are like Vector2, but instead they have a scale and offset. Scale means it scales with the device. Offset is measured in pixels.
You can select the GUI in your explorer and run this code on the Run Command line:
for _,v in pairs(game:GetService("Selection"):Get()[1]:GetDescendants()) do if not v:IsA("GuiObject") then print("g") continue end local x = v.Parent:IsA("GuiObject") and v.AbsoluteSize.X/v.Parent.AbsoluteSize.X or v.AbsoluteSize.X/workspace.CurrentCamera.ViewportSize.X local y = v.Parent:IsA("GuiObject") and v.AbsoluteSize.Y/v.Parent.AbsoluteSize.Y or v.AbsoluteSize.Y/workspace.CurrentCamera.ViewportSize.Y v.Size = UDim2.fromScale(x,y) end
This will set all the GUIObjects within the GUIBase to Scaled values, meaning it would fit in all devices.
My recommendation would be to set the frame that holds everything in it’s size to scale (instead of something like (0, 60, 0, 200) to (0.1, 0, 0.4, 0)). You can automate this process using this lovely extension (AutoScale Lite - Roblox).
Also, to make it have the same sort of shape no matter the screen size, click the “Add Constraint” button.
My bad. Size is actually measured in the parent’s size. If you put the label in a frame, it will scale with the size of the frame. If you put it in a screen gui, then it will scale with the screen
RelativeXY means the Size.X of the Gui will be depending on the screen’s X axis, same goes for Size.Y on the screen’s Y axis.
RelativeXX means both the Size.X and Size.Y of the Gui will be depending on the X axis of the screen. RelativeYY is the same except it’s depending the Y axis of the screen.