Pivot options for Sprite #2225
Labels
A-Rendering
Drawing game state to the screen
C-Feature
A new feature, making something new possible
C-Usability
A targeted quality-of-life change that makes Bevy easier to use
What problem does this solve or what need does it fill?
Having sprites be centered by default is not bad, but e.g. for strategy games where math is used to determine the current tile from the mouse position, it can cause offsets, so in certain scenarios it would be preferable to have sprites be non-centered, aka having the pivot in the corner of the lowest X/Y coordinates.
What solution would you like?
Some sort of option to configure this. be that a simple
centered: bool
on the Sprite, or an additional (enum?) component on the entityWhat alternative(s) have you considered?
currently, the work around is consider the offset in the math for getting the current cell. Though it was unexpected and I am certain there are more usecases where non-centered sprites would be preferable.
Additional context
I might be tackling this myself in the coming days, this seems like an easy enough task for a beginner like me. :)
The text was updated successfully, but these errors were encountered: