EverestAPI / EverestAPI/Everest
Better animation system
- Dominant language
- C#
- Stars
- 516
- Forks
- 106
- Avg merge
- 4d 9h
- Merged PRs (30d)
- 5
Description
### I am planning on implementing this myself
Yes
### Describe your request
The `Tween` class is nice and all, but it would be great to have a Unity-style `AnimationClip` containing multiple tweens with the option for rewinding, etc.
My rough idea is to have a builder that creates animation clips, but these could also be defined in XML for reuse and performance.
```cs
// loading a reusable animation from the animation bank
AnimationClip clip = GFX.AnimationBank["MyCoolAnimation"].Create();
// playing it
entity.Add(new Animator(clip));
```
Example of what a programmatic version could potentially look like:
```cs
AnimationClip clip = AnimationBuilder.Instance
.PushUnion() // runs animations in parallel
.Add(player.Sprite.AnimateScale(new Vector2(2, 2), duration: 4f, delay: 1f))
.PushGroup() // runs animations in series
.Add(player.AnimatePosition(new Vector2(100, 200), duration: 3f))
.Add(player.AnimatePosition(new Vector2(100, 300), duration: 1f, delay: 1f))
.Pop()
.Pop()
.Finish();
```
Creates the following animations:
```cs
var pos1 = player.AnimatePosition(new Vector2(100, 200));
var pos2 = player.AnimatePosition(new Vector2(100, 300));
var scale = player.Sprite.AnimateScale(new Vector2(2, 2));
```
And executes them over 5 seconds like so:
```cs
// 0-----1-----2-----3-----4-----5
// |scale..................|
// |pos1.............| |pos2.|
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.