Table of Contents

Class Tween<T>

Namespace
SharpConsoleUI.Animation
Assembly
SharpConsoleUI.dll

A generic tween that interpolates a value from start to end over a duration, applying an easing function and invoking callbacks on update and completion.

public sealed class Tween<T> : IAnimation

Type Parameters

T
Inheritance
Tween<T>
Implements
Inherited Members
Extension Methods

Constructors

Tween(T, T, TimeSpan, EasingFunction, IInterpolator<T>, Action<T>?, Action?)

Creates a new tween interpolating from from to to.

public Tween(T from, T to, TimeSpan duration, EasingFunction easing, IInterpolator<T> interpolator, Action<T>? onUpdate = null, Action? onComplete = null)

Parameters

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

Properties

IsComplete

Whether the animation has finished or been cancelled.

public bool IsComplete { get; }

Property Value

bool

Methods

Cancel()

Cancels the animation, marking it as complete.

public void Cancel()

Update(TimeSpan)

Advances the animation by the given delta time.

public void Update(TimeSpan deltaTime)

Parameters

deltaTime TimeSpan