Closed karai17 closed 9 years ago
- Elements will have a bring_forward() and send_behind() function set that re-positions them within the draw stack
- the aforementioned functions will take a single argument that allows you to determine the offset where you want to place the element within the stack
- send_back(1) places the element after the first item in the stack
- bring_forward(1) places the element before the last item in the stack
Functionality that behaves something like "bring to front", "send to back", "set index", and "exchange with" makes more sense to me, I think (where "bring to front" and "send to back" wouldn't take any arguments.)
That might make it less confusing, yeah.
It should also be noted that when moving an element from root to parent, the spritebatch which is now empty should be destroyed.
I've gone ahead and added @slime73's methods.
After discussing the idea of ordering, buffering, and drawing elements, I think the following system may be wise:
Some example uses:
I think this could work pretty well and give designers enough control without forcing them to manage their own z-index table. Thoughts?