Closed Pengiie closed 8 months ago
Previously text was already rendered after other vectors so it would always appear on top, I changed this behavior to follow along with the ordering of all the other vectors, regardless if it's text or not.
This is a good change too imo. Since it's possible to spawn graphics with a transform (and hence, Z-index) it's still possible for the user to display text above all else by setting the Z to f32::MAX
.
Changes
RenderMode
struct to defineRenderMode::ScreenSpace
orRenderMode::WorldSpace
.Layer
struct which previously defined the draw order.Redid the render ordering to sort by the vector's z position since the transform is already being included for a 2d affine transformation so the z component doesn't go unused; this is assuming the z component of the transform isn't used to represent other things. Vectors in world-space are rendered first, then screen-space so that screen-space vectors have their own independent z-ordering.
Previously text was already rendered after other vectors so it would always appear on top, I changed this behavior to follow along with the ordering of all the other vectors, regardless if it's text or not.