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

Tips for trying to change GUI size based on user input?

Asked by 5 years ago
Edited 5 years ago

I noticed that on some devices the GUI in my game looks very odd, and I want a way to change that. I want to do something like MM2 where, at the beginning, a GUI pops up asking what device you play on. Based on that, it resizes your menus. Does anyone have any tips for implementing a system like this into my game?

1 answer

Log in to vote
1
Answered by
Nowaha 459 Moderation Voter
5 years ago

Using 'Scale' instead of offset for setting the size of your GUI components will make it automatically resize for all screen sizes. If you want to e.g. make a list more compact, you can make a seperate GUI object better fit for mobile devices in the player's GUI folder and then show that if they are on mobile, and if they are on PC show the normal GUI object.

You can then ask the player what kind of device they are on when they join, and then store that setting i.e. inside of their player object in a string value. Then whenever you show a GUI you can check what value the stringvalue has and show the right GUI based off of that.

0
Thank you! NickIsANuke 217 — 5y
Ad

Answer this question