Hello! I’m trying to design UI for my game (again). It have a lot of diffirent parts which can be hided/unhided, like hotbar, inventory, health/stamina etc bars, some other buttons and maybe something extra, so I got question: what’s better?
A lot of ScreenGui’s:
Or one ScreenGui with many Frame-holders?
Many ScreenGuis
, to say Organized and to Set a Display Order for them, like a Loading ScreenGui, or a Main Gui that Displays the Players Health or Cash.
One screenGui and inside of it folders like
''Inventory"
“Shop”
“SkillTrees”
“Configurations”
all folders would have different frames, this helps me organizing alot o stuff, and i don’t need to turn on and off alot of different ScreenGuis when i want to , also this cuts alot of time scripting
I personally use one ScreenGui with two frames. One frame depending on the game.
Those two frames are named “Frames” and “Menu”. The names are fairly self-explanatory. All of the stuff for the main menu of the game is in the frame named “Menu”, and all of the other frames for the rest of the game (shop, settings, player stats, buttons, etc.) go into the frame named “Frames”
For extra organization, I put subframes into “Frames” and put everything in there (i.e. frames only accessible by the main menu, admin frames, etc.)
Depending on the type of game, however, I do not include the menu, which is not often. I like all of my games to have a main menu in some form.
But, however you want to organize your GUIs is up to your preference. It’s more coding efficient to use one ScreenGui to easily make frames visible and invisible, etc. But could also be more organized to use multiple ScreenGuis.
After a lot of time, I found answer: For things like this ALWAYS use ScreenGui, and not Frames.
Why?
Answer is simple:
If ScreenGui
Enabled property set to false, it not only will be invisible, but also it won’t re-render any changes to anything inside it. So, this will completely stop render objects.
If you will use Frame
, then if it’s property Visible set to false, then it will still re-render any changes to it, and it’s descendants, which will be one of the memory leak reasons.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.