Skip to content

AnimatedValue Class

An function that applies an EasingBase function between two values.

C#
public class AnimatedValue : Wait, IComponent

Inheritance objectUpdateComponentInstructionBaseWait

Implements IComponent

AnimatedValue(TimeSpan, double, double, EasingBase?)

Section titled “AnimatedValue(TimeSpan, double, double, EasingBase?)”

Creates a new value animated over time.

C#
public AnimatedValue(TimeSpan duration, double startingValue, double endingValue, EasingBase? easingFunction = null)

duration TimeSpan
The total time this animation should run.

startingValue double
The starting value of the animation.

endingValue double
The ending value of the animation.

easingFunction EasingBase
The easing function used during animation. Defaults to Linear.

The easing function assigned to animate the value.

C#
protected EasingBase EasingFunction

The current or last value of the animation.

C#
public double Value { get; }

The stating value of the animation.

C#
public double StartingValue { get; }

The ending value of the animation.

C#
public double EndingValue { get; }

Reset(TimeSpan, double, double, EasingBase?)

Section titled “Reset(TimeSpan, double, double, EasingBase?)”

Resets this object to new values.

C#
public void Reset(TimeSpan duration, double startingValue, double endingValue, EasingBase? easingFunction = null)

duration TimeSpan
The total time this animation should run.

startingValue double
The starting value of the animation.

endingValue double
The ending value of the animation.

easingFunction EasingBase
The easing function used during animation. Defaults to Linear.

Resets the Done flag.

C#
public override void Reset()

On the base class, resets the IsFinished to false. Override this method to reset the derived class’ counters and status flags for the instruction.

Updates the timer with the time since the last call.

C#
public override void Update(IScreenObject console, TimeSpan delta)

console IScreenObject
The parent object.

delta TimeSpan
The time since the last frame update.

Raised when the instruction is running and the value changes during Update(IScreenObject, TimeSpan).

C#
public event EventHandler<double>? ValueChanged

EventHandler<double>