Table of Contents

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

int

HasActiveAnimations

Whether any animations are currently running.

public bool HasActiveAnimations { get; }

Property Value

bool

Methods

Add(IAnimation)

Adds a pre-built animation to the manager.

public void Add(IAnimation animation)

Parameters

animation IAnimation

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

from Color
to Color
duration TimeSpan
easing EasingFunction
onUpdate Action<Color>
onComplete Action

Returns

IAnimation

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

from byte
to byte
duration TimeSpan
easing EasingFunction
onUpdate Action<byte>
onComplete Action

Returns

IAnimation

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

from int
to int
duration TimeSpan
easing EasingFunction
onUpdate Action<int>
onComplete Action

Returns

IAnimation

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

from float
to float
duration TimeSpan
easing EasingFunction
onUpdate Action<float>
onComplete Action

Returns

IAnimation

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

from T
to T
duration TimeSpan
interpolator IInterpolator<T>
easing EasingFunction
onUpdate Action<T>
onComplete Action

Returns

IAnimation

Type Parameters

T

Cancel(IAnimation)

Cancels a specific animation.

public void Cancel(IAnimation animation)

Parameters

animation IAnimation

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

deltaTime TimeSpan