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

Conversation

@VictorKoenders
Copy link
Contributor

VictorKoenders commented Dec 21, 2018

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 left a comment

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

This comment has been minimized.

Copy link
Contributor Author

VictorKoenders commented Dec 21, 2018

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();

This comment has been minimized.

Copy link
@17cupsofcoffee

17cupsofcoffee Dec 21, 2018

Owner

You've still got the old method name here.

@VictorKoenders

This comment has been minimized.

Copy link
Contributor Author

VictorKoenders commented Dec 21, 2018

Derp, fixed

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

This comment has been minimized.

Copy link
Owner

17cupsofcoffee commented Dec 21, 2018

Merged, thank you again 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.