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

Added some utility functions to animations and updated example #48

Merged
merged 3 commits into from Dec 21, 2018
Merged

Added some utility functions to animations and updated example #48

merged 3 commits into from Dec 21, 2018

Conversation

VictorKoenders
Copy link
Contributor

Noticed that Animation didn't have a way to update the animation when it's already configured.

I've also updated the example. It now has the following buttons:

  • 1: switch to the first (initial) animation
  • 2: switch to a different animation
  • Space: reset the animation to frame 0

Copy link
Owner

@17cupsofcoffee 17cupsofcoffee left a comment

Choose a reason for hiding this comment

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

Definitely interested in having this functionality, and I think the behaviors you've chosen (e.g. resetting when new frames are added) are probably the least surprising way it could work. One minor comment on a method name, but other than that I'm happy to take this as-is :)

src/graphics/animation.rs Outdated Show resolved Hide resolved
@VictorKoenders
Copy link
Contributor Author

I always end up doing that in my code and needing to refactor it afterwards, nasty habit.

Fixed!

self.set_animation_2();
}
if input::is_key_pressed(ctx, Key::Space) {
self.animation.restart_animation();
Copy link
Owner

Choose a reason for hiding this comment

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

You've still got the old method name here.

@VictorKoenders
Copy link
Contributor Author

Derp, fixed

@17cupsofcoffee 17cupsofcoffee merged commit 225fcca into 17cupsofcoffee:master Dec 21, 2018
@17cupsofcoffee
Copy link
Owner

Merged, thank you again 😄

@VictorKoenders VictorKoenders deleted the improved_animation branch August 5, 2020 07:11
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