-
Notifications
You must be signed in to change notification settings - Fork 68
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
Animating sprite sheets #120
Comments
I guess the easiest way to do this would be to add some additional methods to |
But you can have an indirection in your custom |
Just to confirm, say if I have an animation with 3 frames, taking Tween::new(
EaseMethod::Linear,
Duration::from_millis(600),
MyCustomLens {
frames: vec![frame1, fram2, frame3],
durations: vec![Duration::from_millis(100), Duration::from_millis(200)],
},
); Where I'd use the This is fine except there's now redundancy between the This aside, I feel like it would be still helpful to have some of the methods on |
Yes essentially. Except I think it's more common for each frame to have a duration for which it's visible, than to have what looks like inter-frame durations. But that's a detail, depends on what data you have.
Well, you're abusing an animation system (tweening) to play an animation of another type (sprite animation). So yes it's not unexpected to have 2 different time references. But you can always make a helper that will create the proper
Yes. Except that as explained on the relevant issue there's a design question about sequence repeat, which more of less boils down to what happens if you put an infinite tween inside a repeatable sequence? Any tween after the infinite one will never play. But then what happens if you seek from end? All those become edge cases with no intrinsic or expected answer. Not that I don't want to have repeatable sequences; I just can't find a single tangible proposal for it which doesn't fall apart when considering those edge cases. |
@feelingsonice any more question or concern or this, or can we close this issue? Did you manage to do what you were trying? |
First of all. Thanks for this repo. I just discovered it and it's really well made and saving me a lot of time.
It feels natural to use this to tick the index of a
TextureAtlas
so I gave it a thought. I'm coming up on some loose ends. Here's what I can gauge:Tween
to tick theTextureAtlas
doesn't feel right since each frame of the index could take varying amounts of time.Tween
only takes one duration.Tween
intoSequence
is verbose, and loses some of the functionality ofTween
, such as the ability to repeat the sequence as a whole or sending events on completion.EaseMethod::Discrete
for this purpose but the value returned byprogress
is exclusive, hence you're limited to doing something likeEaseMethod::Discrete(0.999)
, which isn't that bad but feels hacky. This is what I'm coming up against if I were to choose to implement a customLens
.Any thoughts on how to use it to tick sprite sheet indices? Is this something you could support?
The text was updated successfully, but these errors were encountered: