I was using z coordinate to sort the entities before drawing them, but I have faced some situations where the z coordinate is not enough to solve the issues.
My issues:
- Dragging a window, I need that it comes to the front over the other windows. I can increase the z to the maximum z.
- Selecting a windows, needs to bring it also to the front. I can increase the z to the maximum z.
- All the children elements must be drawn in front of the window. I solved this adding the parent's z coordinate to children.
After those issues, I realized that what I need is a sorted list, the order is important, and not the z coordinate.
My question is:
Do you use the z coordinate in your GUIs?
In which situations?
I want to be prepared for future scenarios ?
Thanks!