-
Notifications
You must be signed in to change notification settings - Fork 4
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 PxFlip for sprite and tile. #8
base: main
Are you sure you want to change the base?
Conversation
Added sprite_flip.rs and tilemap_flip.rs in examples as well. The sprite_flip appears to work well. The tilemap_flip seems to work for x-axis flip but not y-axis.
Nice, thank you. I will take a closer look at this soon.
Fair, yeah, it's kind of a mess of math |
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.
Thanks! If you do these things and get CI to pass, I'll merge
@@ -301,13 +301,13 @@ fn extract_maps<L: PxLayer>( | |||
} | |||
} | |||
|
|||
pub(crate) type TileComponents = (&'static PxTile, Option<&'static PxFilter>); | |||
pub(crate) type TileComponents = (&'static PxTile, Option<&'static PxFilter>, Option<&'static PxFlip>); |
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.
Make this non-optional and add PxFlip
as a required component on PxTile
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.
Can do.
@@ -400,14 +416,15 @@ pub(crate) type SpriteComponents<L> = ( | |||
&'static PxCanvas, | |||
Option<&'static PxAnimation>, | |||
Option<&'static PxFilter>, | |||
Option<&'static PxFlip>, |
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.
Same as earlier comment, but for PxSprite
Added sprite_flip.rs and tilemap_flip.rs in examples as well. The sprite_flip appears to work well. The tilemap_flip seems to work for x-axis flip but not y-axis.
I did not add any flip for text because I wasn't even sure what it might mean and it looked complicated.