Skip to content
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

Pivot options for Sprite #2225

Closed
Byteron opened this issue May 20, 2021 · 1 comment
Closed

Pivot options for Sprite #2225

Byteron opened this issue May 20, 2021 · 1 comment
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

Comments

@Byteron
Copy link
Contributor

Byteron commented May 20, 2021

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 entity

What 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. :)

@Byteron Byteron added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels May 20, 2021
@alice-i-cecile alice-i-cecile added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled labels May 20, 2021
@mockersf
Copy link
Member

related to #1616

@bors bors bot closed this as completed in 8e864fd Apr 4, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this issue Jun 7, 2022
# Objective

- Fixes bevyengine#1616, fixes bevyengine#2225
- Let user specify an anchor for a sprite

## Solution

- Add an enum for an anchor point for most common values, with a variant for a custom point
- Defaults to Center to not change current behaviour


Co-authored-by: François <[email protected]>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this issue Feb 1, 2023
# Objective

- Fixes bevyengine#1616, fixes bevyengine#2225
- Let user specify an anchor for a sprite

## Solution

- Add an enum for an anchor point for most common values, with a variant for a custom point
- Defaults to Center to not change current behaviour


Co-authored-by: François <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants