Class AnimatedShaderEffect
Animated shader effect driven by a RangeAnimator (progress 0→1). Attach to a SkiaImage (or any cached control), call Play(), remove on Completed.
Usage: var fx = new AnimatedShaderEffect { ShaderSource = @"Shaders\yourshader.sksl" }; fx.Completed += (s, e) => { _backgroundImage.FX.Remove(fx); fx.Dispose(); }; _backgroundImage.FX.Add(fx); fx.Play(_backgroundImage);
public class AnimatedShaderEffect : SkiaShaderEffect, INotifyPropertyChanged, IDisposable, IPostRendererEffect, ISkiaEffect, ICanBeUpdatedWithContext, ICanBeUpdated
- Inheritance
-
AnimatedShaderEffect
- Implements
- Inherited Members
- Extension Methods
Fields
Animator
protected RangeAnimator Animator
Field Value
Properties
Center
Normalized center position of the effect (0.0–1.0 in each axis).
public SKPoint Center { get; set; }
Property Value
DurationMs
Total animation duration in milliseconds. Default 2500.
public uint DurationMs { get; set; }
Property Value
Progress
Current animation progress 0.0 → 1.0. Set automatically by Play(); can also be set manually for debugging.
public double Progress { get; set; }
Property Value
Methods
CreateUniforms(SKRect)
Creates uniforms fresh each time
protected override SKRuntimeEffectUniforms CreateUniforms(SKRect destination)
Parameters
destinationSKRect
Returns
OnCompleted()
protected virtual void OnCompleted()
OnDisposing()
Simplified dispose - only CPU-side resources
protected override void OnDisposing()
Play()
Starts the celebration animation on the given parent control. Safe to call multiple times — restarts from zero each time.
public virtual void Play()
Stop()
Stops the animation without firing Completed.
public virtual void Stop()
Events
Completed
public event EventHandler Completed