Please increase the maximum ZIndex, I feel like it limits your ability to place frames correctly. For example, I was going to test around with an 8 card hand in my card game until I realized there would be glitches for the last and/or second to last cards due to the limit.
No need.
Just cut and paste a GUI back into a parent.
The GUIs with similar Zindex will appear in order of newest child on top.
[quote] No need.
Just cut and paste a GUI back into a parent.
The GUIs with similar Zindex will appear in order of newest child on top. [/quote]
That seems a bit messy once you get into the thick of it.
[quote] No need.
Just cut and paste a GUI back into a parent.
The GUIs with similar Zindex will appear in order of newest child on top. [/quote]
By that logic having ZIndex at all is pointless. It’s a matter of convenience.
Z Index used to be bigger. While we’re on the topic, is it just me or when you add a new ScreenGui it ignores the layering of the other ScreenGuis.
“The GUIs with similar Zindex will appear in order of newest child on top.”
This is also pretty much defacto-supported behavior, as quite a bit of official code relies on that behavior.
Normally the right way to do things is using child-order and hierarchy structure, rather than ZIndex, to organize your GUIs. ZIndex is bad because it prevents the UIs that you make from nicely interacting with one and other when you try to re-use them between places. You should reserve ZIndex for only places where it’s really necessary to have the resulting code be nice, such as giving all of your modal UI a separate ZIndex to draw on.
For example, you can have a “BaseUI” and a “FloatingUI” frame, where you insert the BaseUI frame first, and then put all of your things inside of one of those two frames. That way all of your floating UI will be on top of the base UI without requiring you to do a whole bunch of fiddling with ZIndices, or having to mess with stuff a lot if the “layer” of one of your components changes from floating to base.
In the example of card game given, say there was a hover state that made the card appear above the others. Then when the hover is taken away, the card returns to its original place. Code for that soon becomes messy when you get towards 10 cards as you have to reorganise every other card or remove and replace the hovered card which would detach the event and cause more issues
In the example of card game given, say there was a hover state that made the card appear above the others. Then when the hover is taken away, the card returns to its original place. Code for that soon becomes messy when you get towards 10 cards as you have to reorganise every other card or remove and replace the hovered card which would detach the event and cause more issues[/quote]
You shouldn’t need to draw on more than a few planes
“In the example of card game given”
A card game is going to have pretty hairy layer management if you want it to feel perfect no matter how you do it.
“the card returns to its original place.”
Having more ZIndices isn’t really going to help you that much in the case you’re talking about unless you had unlimited ZIndices and used a bunch of ugly hard-coded ZIndex ranges like Base UI = [1-10000], Cards = [10000-20000], UI = [20000-30000]. Otherwise the ZIndices would solve the card ordering problem… but then when you went to make some modal UI, you’d have no “right” ZIndex to put the modal UI at to make sure that it’s above all of the cards.