Lilt
A simple, dependency free library for running interruptable, transition based animations as a function of time.
This library only implements animations & would be most useful along with a GUI library that can do GUI things (like iced).
Getting Started
Embed the state you want to animate in an Animated struct.
When you initialize your view state - choose the duration & easing you want.
MyViewState
When your state needs an update, call the transition function on your animated state, passing the current time.
let now = now;
self
.animated_toggle
.transition
While rendering a view based on your state - use the interpolate function on your animated state to get the in-between value for the current frame.
let now = now;
// Use the interpolated float for something like width, height, offset
let interpolated_width = self.animated_toggle.interpolate
// Or add an `Interpolable` implementation to an object of your choice, like a color
let interpolated_color = self.animated_toggle.interpolate