-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow to explicitly define the z-order #9713
base: main
Are you sure you want to change the base?
Conversation
Welcome, new contributor! Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨ |
6f6004d
to
14c8d97
Compare
Related to #1275. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very much in favor of moving away from using the Transform's z value for ordering 2D objects, one way or another.
It feels like this would be better suited as a distinct component (so then it can be reused across sprites and UI, and avoid increasing the size of Sprite
) rather than as a field on Sprite
.
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
Status ? I don't think using Transform for this is a good idea as it could have unintended side effects. Rather, I think it should affect to Bevy Render order instead Edit : I currently create another entity for the sprite and set the parent to the desired entity and this would avoid most side-effects |
Objective
This allows to specify an explicit z value for ordering instead of relying on the z translation value which might already be used for actual positioning.
Solution
We add an extra optional field that can be set. The default behavior of using the z translation does not change.
Changelog
Added