Table of Contents

Class FrameCycleAnimation

Namespace
SharpConsoleUI.Animation
Assembly
SharpConsoleUI.dll

A looping animation that advances a frame index on a fixed interval and never self-completes. Used by spinner controls and helpers. Ticked on the UI thread via AnimationManager; invokes the callback only when the index changes.

public sealed class FrameCycleAnimation : IAnimation
Inheritance
FrameCycleAnimation
Implements
Inherited Members
Extension Methods

Constructors

FrameCycleAnimation(int, TimeSpan, Action<int>)

Creates a looping frame-cycle animation.

public FrameCycleAnimation(int frameCount, TimeSpan interval, Action<int> onFrame)

Parameters

frameCount int

Number of frames to cycle through.

interval TimeSpan

Time between frame advances.

onFrame Action<int>

Invoked with the new frame index whenever it changes.

Properties

CurrentFrame

The current frame index (0-based).

public int CurrentFrame { get; }

Property Value

int

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