-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
Adjust the offset of the key frame #1181
Comments
Hmm, that's a good question. As far as I can remember, FXGL does not support offsets for each frame. Sounds like a very useful feature to have. Can you provide a simple (ideally, minimal) demo with an appropriate sprite sheet and I'll see if we can implement this relatively soon... |
Thanks for your reply, I submitted a simple demo at https://github.com/ngcin/fani which includes a monster's attack animation. The animation structure description is a json file (/assets/data/monster.json), and the "res" node describes each frame image position in sprite sheet, "frames" describes the offsets of the frame . |
Thanks, I've had a quick look. If I understand correctly, we can potentially solve this by:
Would that work for your (and also general) use case? |
Yes, entirely accurate! This is exactly what I thought, this function is very helpful for us to use existing texture materials, thank you! |
Demo here: https://twitter.com/AlmasBaim/status/1546529789946773506 To get the latest build, you can use this:
|
Since the image size of each frame is different, I want to align the image of each frame by adjusting the offset of the key frame. If I modify the image, the workload is relatively large. I want to adjust it from the code level. Is there a good way?
The text was updated successfully, but these errors were encountered: