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

Add rotation support for Quad and Sprite #133

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

danheuck
Copy link

Added support for rotating individual Quads and Sprites as mentioned in #1. As a side effect, this ended up moving the anchor point for positions to the center of the Sprite/Quad since the Sprites needed to be centered on the origin before they could be rotated. In my opinion, this behavior is often preferable anyway, but I realize it's subjective. I can try to figure out a way to apply the rotation without moving changing the way sprite positioning works if desired, but I'm far from an expert on transformation matrices.

#1 mentioned concerns that adding rotation support would negatively impact performance. I did not add any benchmarks, but anecdotally testing with the particles example did not show any significant difference with or without the change.

effect, sprite and quad positions are now anchored
at the center of the sprite/quad. Updated all ui
widgets and examples to work with the new anchor point.
Updated the image.rs example to include a panel since I
needed to make sure I hadn't changed its behavior.
rotation fields for sprites and quads.
progress bar for top left corner anchoring
and reverted change to test/graphics.rs
@danheuck
Copy link
Author

Just added a few more commits that move the anchor point back to the top left corner and revert most of the changes I made to the UI renderers as a consequence of the anchor point moving.

@KimPlaybit
Copy link

I would like to see this merged aswell. Most games use this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants