Class AnimationManager
- Namespace
- SharpConsoleUI.Animation
- Assembly
- SharpConsoleUI.dll
Manages active animations, advancing them each frame and removing completed ones. Owned by ConsoleWindowSystem.
public sealed class AnimationManager
- Inheritance
-
AnimationManager
- Inherited Members
- Extension Methods
Properties
ActiveCount
Number of currently running animations.
public int ActiveCount { get; }
Property Value
HasActiveAnimations
Whether any animations are currently running.
public bool HasActiveAnimations { get; }
Property Value
Methods
Add(IAnimation)
Adds a pre-built animation to the manager.
public void Add(IAnimation animation)
Parameters
animationIAnimation
Animate(Color, Color, TimeSpan, EasingFunction?, Action<Color>?, Action?)
Creates and starts a Color tween animation.
public IAnimation Animate(Color from, Color to, TimeSpan duration, EasingFunction? easing = null, Action<Color>? onUpdate = null, Action? onComplete = null)
Parameters
fromColortoColordurationTimeSpaneasingEasingFunctiononUpdateAction<Color>onCompleteAction
Returns
Animate(byte, byte, TimeSpan, EasingFunction?, Action<byte>?, Action?)
Creates and starts a byte tween animation.
public IAnimation Animate(byte from, byte to, TimeSpan duration, EasingFunction? easing = null, Action<byte>? onUpdate = null, Action? onComplete = null)
Parameters
Returns
Animate(int, int, TimeSpan, EasingFunction?, Action<int>?, Action?)
Creates and starts an int tween animation.
public IAnimation Animate(int from, int to, TimeSpan duration, EasingFunction? easing = null, Action<int>? onUpdate = null, Action? onComplete = null)
Parameters
Returns
Animate(float, float, TimeSpan, EasingFunction?, Action<float>?, Action?)
Creates and starts a float tween animation.
public IAnimation Animate(float from, float to, TimeSpan duration, EasingFunction? easing = null, Action<float>? onUpdate = null, Action? onComplete = null)
Parameters
fromfloattofloatdurationTimeSpaneasingEasingFunctiononUpdateAction<float>onCompleteAction
Returns
Animate<T>(T, T, TimeSpan, IInterpolator<T>, EasingFunction?, Action<T>?, Action?)
Creates and starts a generic tween animation with a custom interpolator.
public IAnimation Animate<T>(T from, T to, TimeSpan duration, IInterpolator<T> interpolator, EasingFunction? easing = null, Action<T>? onUpdate = null, Action? onComplete = null)
Parameters
fromTtoTdurationTimeSpaninterpolatorIInterpolator<T>easingEasingFunctiononUpdateAction<T>onCompleteAction
Returns
Type Parameters
T
Cancel(IAnimation)
Cancels a specific animation.
public void Cancel(IAnimation animation)
Parameters
animationIAnimation
CancelAll()
Cancels all active animations.
public void CancelAll()
Update(TimeSpan)
Advances all active animations by deltaTime and removes completed ones. Delta time is capped to prevent animations completing instantly after idle periods.
public void Update(TimeSpan deltaTime)
Parameters
deltaTimeTimeSpan