-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Sprite component #247
Comments
Not sure if it'd be useful here, but this is the nicest way that I've come across to declare sprite animations in code: If you name your images "idle0.png", "idle1.png", "idle2.png", "walk0.png", "walk1.png". Then, when you declare your e.g., idle animation, you can specify order and delay:
So the animation above would show images 0-2 for 1 frame each, then frame 0 for 2 frames, then frame 1. |
I'll take this. (I see it's marked "Good First Issue", but I'd really like to see if I can improve on the DX of the Drei version.) QuestionsThe Drei version accepts a JSON texture atlas / packed sprites.
Otherwise, some options:
|
Hey @andretchen0 ✌ ! I don't know if you know TexturePacker, I've used it a few times and it's always been quick and easy to use. |
Thanks for the recommendation! I have checked out TexturePacker in the past and it's a great tool. Maybe one of the others can chime in to the contrary if I'm wrong, but I think for Tres/Cientos, we'd want to have a free – but ideally FOSS – tool that people could use. |
Closing: completed. |
Description
As a developer using Tresjs I would like to create sprite animations by cycling through a sequence of frames from a sprite sheet image or JSON data, so I could add sprites images to my 3D spaces.
Suggested solution
Inspired by: https://github.com/pmndrs/drei#sprite-animator
Alternative
Feel free to suggest other alternatives
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: