Question about depth (Z-axis)
Posted: Sat Dec 05, 2015 10:10 am
I'm writing some sort of an engine/framework on top of Löve, and have a question.
I have a Vector2 pseudoclass( https://gist.github.com/Elmuti/b1d37f2b5784be76a683 )that I use for Position and Velocity.
My framework/engine will be very object oriented, meaning that I will have UI classes such as Frames, Textboxes, Textlabels etc.
However I know that I need a depth system to define how all the 2d objects on screen layer on top of eachother.
I was wondering if I should just have a ZIndex property in all drawn classes that defines the drawing order, or if I should use Vector3's instead, and having the Z-axis as depth. Or maybe even a completely different approach.
What do you guys think I should do?
I have a Vector2 pseudoclass( https://gist.github.com/Elmuti/b1d37f2b5784be76a683 )that I use for Position and Velocity.
My framework/engine will be very object oriented, meaning that I will have UI classes such as Frames, Textboxes, Textlabels etc.
However I know that I need a depth system to define how all the 2d objects on screen layer on top of eachother.
I was wondering if I should just have a ZIndex property in all drawn classes that defines the drawing order, or if I should use Vector3's instead, and having the Z-axis as depth. Or maybe even a completely different approach.
What do you guys think I should do?