How to make a gui object the same fo every device?

Hi,
I have a custom inventory system and how can i make this sample for items to be the same size for every device?

Heres how it in my window:
Screenshot_173

Heres how it in this phone for example:

How to make it smaller for phone? And size it for all devices at all?

3 Likes

Parent that TextButton to the frame, use Scale instead of Offset when sizing the UI element properly, change the SizeConstraint property to let the one axis’ size be relative to the other’s.

1 Like

As @Loumec said, if you go into the properties of any object you will see Size and Position . Both of them have a Scale and an Offset .

If your game is used cross-platform (from PC to mobile) , you will need to set the Offset to 0 (both X and Y and Z if its a 3D object) and set the Scale to the wanted actual size. Compared to Offset, which is a constant number of pixels taken by the GUI in this case, Scale is a proportional number who will occupy the same place cross-platform without changing it’s size and shape .

By default, once you set the Offset to 0 , you can resize the GUI’s Size manually (not from the Size property).

If you want more info feel free to ask or you can even search in the Developer Hub about Scale and Offset :heart:

1 Like

I noticed that this grey buttton looks same on all devices if i will remove the UIGridLayout, but if i return it button will be BIG at phone.
I can fix it somehow?

If the UI is in a different frame, make sure that frame’s offset is 0. If not, remove the GridLayout and put the button’s offset to 0.