Help with this tiny GUI problem. (For my game menu)

Hello, I’ve been wondering because I am really new with UI and GUI design and I just don’t know the solution to this problem. I don’t think it’s a huge issue and it could be a easy fix it’s just I’m not entirely sure how to fix this issue. So basically here is the problem, I’m working on one of my different frames and while I’m expanding the frame I can see all the letters/words from the MAIN frame through it any solution to this? Here is a pic showing what I mean below:

Try to change the zindex in properties of the frame. Zindex is basically a layer editor. I’m sure that there is a more detailed article about how zindex works.

Set the ZIndex property of your frame to an amount lower than the ZIndex of the TextLabels.
Higher ZIndex = will appear above everything else with a lower ZIndex, lower ZIndex = will appear below everything else with a higher ZIndex.

https://developer.roblox.com/en-us/api-reference/property/GuiObject/ZIndex

2 Likes

Put the buttons (Updates/Play/Settings) in the SettingsFrame. Same with the other frames (Put them in the corresponding frame). Otherwise it will never work well and like that it is easier to script the menu!
:+1:

Tysm, That solved it. I had no complete idea abt ZIndex values, Now I’m aware and you just made my life so much easier.

You should not use Z-Index for this purpose. My solution does also work but my solution makes it easy to script. With the Z-Index solution it will be horrible to script the menu to be working.

I’m not a scripter so I don’t know anything about scripting for UIs, Can you explain a little more on that? You can script UIs?

I mainly learned myself how to program on Roblox. In my own game I have programmed some (I think also more complicated) UIs.
The thing you need to do better is that everything that should be displayed in the settings for example, should be a child of the SettingsFrame, so that a simple script makes the UI functional.
That way the script can just call the frame and make it visible and doesn’t have to call every single object and make it visible.

If you need help scripting for UI elements I can help you, but you should try to do it yourself (it’s not that hard).

Sincerely,

CSJeverything

Placing the elements into designated frames/containers will not affect how the elements are layered. Sure, it will make your life easier when scripting but I don’t think “the Z-Index solution it will be horrible” is accurate.

Make it like this:

  • StarterGui
    • Menu
      • Frame
        • StartFrame
          • Updates
          • Play
          • Settings
          • (The TextLabels that belong to the main screen)
          • CloseButton
        • SettingsFrame
          • SettingButton1
          • SettingButton2
          • CloseButton
        • UpdatesFrame
          • The things from Updates
          • CloseButton

Next, add LocalScripts to the buttons and program the button to make the corresponding frame visible. And make close buttons!

Tip: Always use for UI script.Parent. […] and not game.StarterGui. […]. Because the PlayerGui is somewhere in the player and is complicated to find. So for UI I always use script.parent. […].

It kinda makes layering, because you only need to set a Z-Index for the parented frame.
It definitely is not the better solution to have everything separated.

You mind giving me your discord so I don’t lose you?

I don’t use Discord, but you can always message me via the DevForum.

Alright, I’ll follow you for the start.

This is not true. Regardless of the ZIndex of the parent frame, the children respect their own ZIndex properties.

But the Z-Index of the children is always above the parented frame.

What are you talking about? If I were to set the ZIndex of this sidebar higher than it’s children, the children would be layered below it?

Let’s not argue about that. This is very much off topic.