Hey All,
Could you please clarify the benefits of using a Frame within a ScreenGUI? I’m thinking of a basic scenario to display information on a player’s screen. Examples by others start at StarterGui. Then insert a ScreenGui. Under ScreenGui they insert a Frame. Within the Frame they insert a TextLabel. But…I can insert a TextLabel directly child under ScreenGui, position/size it as I want, and it appears on the player screen just fine. No use of Frame. What extra features am I overlooking by not utilizing a Frame in between the ScreenGui and the TextLabel?I’m pretty new to Roblox Studio and all things related. I apologize if my question seems too basic.
2 Likes
The biggest reasons I personally put all my GUI objects inside transparent frames are the following:
A. It’s great for organization, because you can keep groups of objects separated, without having to use a million ScreenGui’s. The key benefit to using a Frame over a Folder
as a container object is the ability to further manipulate the GuiObject.Size
and GuiObject.Position
of any descendant GuiObject
s.
B. If you wanted to move or Tween objects as a group, you could edit the Position of the parent Frame, instead of needing to move every object inside the ScreenGui individually.
C. It works as a great positioning device for elements. Since a Frame does not have to take up the entirety of the player’s screen, it can be used to divide and split everything up, allowing you to have different quadrants of your screen organized easily. It can be used as similarity to the “div” tag in HTML.
In terms of a singular UI element, parenting to a Frame isn’t going to affect much. However, it is a good habit to get in to, because the more you add onto your project, the more complicated everything becomes, and you never know when you might need to shift segments of your interface around.
That was a good question! I hope the above helps.
7 Likes
Those are solid points you mention. Thank you for taking the time to give your reasons. I’m still placing one or two items on the screen at this point, but I can see how the screen can become filled with various objects. If using a Frame will help to organize it better, then I’ll put Frame usage into practice!
3 Likes