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 Atlas example using multiple unique sprites #2283

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

Conversation

dcarubia
Copy link

This PR adds an example to the Atlas docs showing an Atlas texture being used to render multiple unique sprites to form a pattern

@wcandillon
Copy link
Collaborator

Thanks a lot Danny, you're catching something really interesting here :)
To implement this example, we would use the color property actually with a single sprite (a path).

Also we would need to add the example here: https://github.com/Shopify/react-native-skia/blob/main/package/src/renderer/__tests__/e2e/Atlas.spec.tsx#L278 (you can read more about writing these tests at https://github.com/shopify/react-native-skia?tab=readme-ov-file#contributing) But if this is too much I could do it too.

@wcandillon wcandillon self-requested a review March 14, 2024 11:24
Copy link
Collaborator

@wcandillon wcandillon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This particular example shouldn't be title "Multiple Unique Sprites" but rather "Using the colors property"

@dcarubia
Copy link
Author

Thanks @wcandillon , that makes sense. I'll update this example to use the color prop with a single sprite. Re: adding tests - happy to do that as well but likely won't get to that until next week so feel free to get this across the line sooner if that works better for you!

I still think a demo showing how to use multiple sprites in an atlas would be valuable so if you agree I can work on another example that does a better job of showing that use case. Potentially something similar but with a few unique shapes, or an example with images could be interesting (could we show a strategy for loading the images to use in the texture?). Lmk if you have thoughts :)

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