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

Feat/useSpriteLoader #1790

Merged
merged 15 commits into from
Jan 28, 2024
Merged

Feat/useSpriteLoader #1790

merged 15 commits into from
Jan 28, 2024

Conversation

netgfx
Copy link
Contributor

@netgfx netgfx commented Jan 22, 2024

Why

Added the useSpriteLoader to better streamline sprite loading and be able to batch multiple sprites into one sprite-sheet, load it once and use it across multiple SpriteAnimator components.

Modified the SpriteAnimator code to internally also use useSpriteLoader in order to not break compatibility with previous versions and still be able to load textures directly from the SpriteAnimator parameters.

This way loading and parsing live on the loader, which makes it easier for new formats to be supported without jeopardising or bloating the SpriteAnimator component.

useSpriteLoader supports all the formats that SpriteAnimator used to support:

  • Standalone sprite textures
  • JSONHash along with non-trimmed texture
  • JSONArray along with non-trimmed texture

Sample: https://codesandbox.io/p/sandbox/r3f-sprite-animator-v3-0-usespriteloader-wip-forked-fyysqy

What

Added useSpriteLoader under loaders on README and added the component file
Modified SpriteAnimator to internally use useSpriteLoader as well

Checklist

  • [x ] Documentation updated (example)
  • Storybook entry added (example)
  • [x ] Ready to be merged

Copy link

vercel bot commented Jan 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 8:03am

Copy link

codesandbox-ci bot commented Jan 22, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0e6c6a0:

Sandbox Source
divine-snow-wc7xjt Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@netgfx netgfx merged commit ffb815d into pmndrs:master Jan 28, 2024
4 checks passed
Copy link

🎉 This PR is included in version 9.97.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

1 participant