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

How to arrange the stack order of Gui's if Z index is not working?

Asked by 7 years ago
Edited 7 years ago

I change the Z index of a text box and it won't appear in front of the frame I want instead it appears behind it.

2 answers

Log in to vote
1
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

In roblox gui's everything that is created FIRST, gets rendered FIRST. (If you'd create 2 frames, the 2nd frame would be rendered "on top" / "over" of the first one.)

I have to admit, Roblox's Z-Index is pretty bad, though it has its functionality.

Everything has to be inside the SAME ScreenGui for it to have a good effect.

How it works:

--[[
Structure:
Frame1      - ZIndex 1
-Frame2     - ZIndex 1
--TextButton    - ZIndex 1

Foreground / view order:
TextButton
Frame2
Frame1

-----------

Structure:
Frame1      - ZIndex 1
-Frame2     - ZIndex 2
--TextButton    - ZIndex 1

Foreground / view order:
Frame2
TextButton
Frame1

-----------

Structure:
Frame1      - ZIndex 2
-Frame2     - ZIndex 1
--TextButton    - ZIndex 2

Foreground / view order:
TextButton
Frame1
Frame2

]]
0
"Everything has to be inside the SAME ScreenGui for it to have a good effect." @RubenKan My text box and frame are in two different ScreenGuis. Is there anyway they can be in separate ScreenGui's because that's crazy that they have to be in the same exact ScreenGui. JoeRaptor 72 — 7y
0
Hows that crazy? Just put a frame inside one screen gui for every different gui you want, and put all those frames on size {1,0},{1,0} RubenKan 3615 — 7y
0
@RubenKan I see that as a serious compromise. That's hy I think thats crazy But there's seriously no other way? I have alot of ScreenGui's made separately for specific reasons. I mean it's merely impossible to two separate ScreenGUIs in front of each other? JoeRaptor 72 — 7y
0
Whats the difference between creating multiple screenGui's or multiple frames? There's litheraly no difference. A screenGui is just an invisible frame with size {1,0},{1,0} RubenKan 3615 — 7y
Ad
Log in to vote
1
Answered by 7 years ago

@RubenKan Thank You for all your help. If it weren't for you I wouldn't have bumped into this! For every one having my problem of putting frames and GUIs behind and in front of each other, use the** DisplayOrder** property in your ScreenGUI!!! The higher the property the more front it will go and the lower the property, the more behind it will go!

http://wiki.roblox.com/index.php?title=API:Class/ScreenGui/DisplayOrder

Answer this question