https://github.com/banyango/rust-tween
A tween library for rust.
https://github.com/banyango/rust-tween
Last synced: over 1 year ago
JSON representation
A tween library for rust.
- Host: GitHub
- URL: https://github.com/banyango/rust-tween
- Owner: Banyango
- Created: 2019-01-29T00:04:44.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-29T00:06:16.000Z (over 7 years ago)
- Last Synced: 2025-02-12T09:52:40.085Z (over 1 year ago)
- Language: Rust
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Interpolation Experiment
A library for interpolating values according to different functions.
Note: Not intended for production, I'm using this to learn Rust better.
## Usage
Create a type tween. This will set the tween to alive, and then increment the tween by supplying a delta_time tick.
Sample usage
```
struct A {
tween:Tween
}
impl A {
fn tween_me(&mut self) {
tween = Tween::new(0.0, 500.0, 2.0);
tween.set_ease(EaseType::SineIn);
}
fn update_tick(&mut self, delta_time:f32) {
tween.tick(delta_time);
println!("interpolated value is = {}",tween.value);
}
}
```
###todo
- Add support for elastic, bounce, and back interpolation types.
- Figure out a nicer way to have the tween update a reference value...