Table of Contents

Class GenericAnimation

Namespace
FlowGraph.Avalonia.Animation
Assembly
FlowGraph.Avalonia.dll

A generic animation that calls an update action with the normalized progress (0-1). Useful for simple animations or sequencing multiple animation phases.

public class GenericAnimation : IAnimation
Inheritance
GenericAnimation
Implements
Inherited Members

Constructors

GenericAnimation(double, Action<double>, Action?, Func<double, double>?)

Creates a new generic animation.

public GenericAnimation(double duration, Action<double> onUpdate, Action? onComplete = null, Func<double, double>? easing = null)

Parameters

duration double

Animation duration in seconds.

onUpdate Action<double>

Callback called each frame with normalized progress (0-1).

onComplete Action

Callback when animation completes.

easing Func<double, double>

Optional easing function (if null, linear progress is passed to onUpdate).

Properties

IsComplete

Gets whether the animation has completed.

public bool IsComplete { get; }

Property Value

bool

Methods

Cancel()

Called when the animation completes or is cancelled.

public void Cancel()

Update(double)

Updates the animation with the elapsed time since the last frame.

public void Update(double deltaTime)

Parameters

deltaTime double

Time elapsed since last update in seconds.