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 PxFlip for sprite and tile. #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shanecelis
Copy link

@shanecelis shanecelis commented Jan 9, 2025

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.

sprite flip for x-axis

I did not add any flip for text because I wasn't even sure what it might mean and it looked complicated.

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.
@Seldom-SE
Copy link
Owner

Seldom-SE commented Jan 10, 2025

Nice, thank you. I will take a closer look at this soon.

I did not add any flip for text because I wasn't even sure what it might mean and it looked complicated.

Fair, yeah, it's kind of a mess of math

Copy link
Owner

@Seldom-SE Seldom-SE left a 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>);
Copy link
Owner

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

Copy link
Author

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>,
Copy link
Owner

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

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.

2 participants