-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 Sheet Example: Skip "idle" frame. #5429
Conversation
# Objective - Make running animation fluid skipping 'idle' frame. # Solution - Replace `TextureAtlas::from_grid()` with `TextureAtlas::from_grid_with_padding()` and provide an offset of 1 tile. The example is correct, is just the feeling that the animation loop is not seamless.
Afaik with padding also skips the padding space between tiles. Did you intend to do that? |
I don't think not loading the first frame is the correct fix for that. instead, in the |
Thanks for the comments. @mockersf At some point I think you'll have different animations and trigger them somehow. That's why I thought on loading the running animation from the beginning instead of skipping indexes. @mopsalarm I understood that padding will be used if tiles have some paddings, but in this case they don't, so I set it to Vec2.Zero. But as I said, the example is correct and is about sprite sheet, not animations per se. I'm new to Bevy and was trying out the examples. Need to learn more. feel free to reject this PR if makes no sense :) |
In case of different animations, I think you should load only one texture atlas, not skipping any, and then say idle animation is frame 0 to 0 (in this case), running is frame 1 to 7, jumping 8 to 12, ...
It definitely looks better skipping the idle frame. It's funny how I never noticed it but now that you made the change it jumps to my eye 😄 |
# Objective - Make running animation fluid skipping 'idle' frame. ## Solution - Loop through the specified indices instead of through the whole sprite sheet. The example is correct, is just the feeling that the animation loop is not seamless. Based on the solution suggested by @mockersf in bevyengine#5429.
# Objective - Make running animation fluid skipping 'idle' frame. ## Solution - Loop through the specified indices instead of through the whole sprite sheet. The example is correct, is just the feeling that the animation loop is not seamless. Based on the solution suggested by @mockersf in bevyengine#5429.
With #6861 merged, it looks like this can be closed. |
Objective
Solution
TextureAtlas::from_grid()
withTextureAtlas::from_grid_with_padding()
and provide an offset of 1 tile.The example is correct, is just the feeling that the animation loop is not seamless.