Make Anchor work for Rectangle Mesh2d #17088
Labels
A-Rendering
Drawing game state to the screen
C-Feature
A new feature, making something new possible
S-Ready-For-Implementation
This issue is ready for an implementation PR. Go for it!
What problem does this solve or what need does it fill?
Currently inserting
Anchor
when using aRectangle
mesh2d component has no effect (anchor will be the default - center). Given that Anchors work for sprites which IIUC are just rectangle meshes with images on them I don't see why this shouldn't also work for Rectangle mesh2d's.What solution would you like?
Take into account the Anchor component in Mesh2d rendering for the
Rectangle
primitive shape and apply (the same transform logic that exists in the sprite pipeline for anchors)[https://github.com/bevyengine/bevy/blob/3f2baf8ecd7f8948fb67cf11b0f2811d7a1ca1ae/crates/bevy_sprite/src/render/mod.rs#L734].What alternative(s) have you considered?
None.
Additional context
I'd be happy to implement this and submit a PR for it but I'd need some guidance on the implementation.
The text was updated successfully, but these errors were encountered: