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
frameCountintNumber of frames to cycle through.
intervalTimeSpanTime between frame advances.
onFrameAction<int>Invoked with the new frame index whenever it changes.
Properties
CurrentFrame
The current frame index (0-based).
public int CurrentFrame { get; }
Property Value
IsComplete
Whether the animation has finished or been cancelled.
public bool IsComplete { get; }
Property Value
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
deltaTimeTimeSpan