Class EdgeFlowAnimation
Animates an edge's stroke dash offset for a "flow" effect.
public class EdgeFlowAnimation : IAnimation
- Inheritance
-
EdgeFlowAnimation
- Implements
- Inherited Members
Constructors
EdgeFlowAnimation(Edge, double, Action<Edge, double>?, double?)
Creates a new edge flow animation.
public EdgeFlowAnimation(Edge edge, double speed = 50, Action<Edge, double>? onUpdate = null, double? maxDuration = null)
Parameters
edgeEdgeThe edge to animate.
speeddoubleSpeed of the flow animation (pixels per second). Positive = forward (source to target), negative = reverse.
onUpdateAction<Edge, double>Callback called each frame with the edge and current dash offset.
maxDurationdouble?Maximum duration in seconds, or null for infinite.
EdgeFlowAnimation(Edge, double, bool, Action<Edge, double>?, double?)
Creates a new edge flow animation with explicit direction control.
public EdgeFlowAnimation(Edge edge, double speed, bool reverse, Action<Edge, double>? onUpdate = null, double? maxDuration = null)
Parameters
edgeEdgeThe edge to animate.
speeddoubleSpeed of the flow animation (pixels per second, always positive).
reverseboolIf true, flow goes from target to source. If false, flow goes from source to target.
onUpdateAction<Edge, double>Callback called each frame with the edge and current dash offset.
maxDurationdouble?Maximum duration in seconds, or null for infinite.
Properties
CurrentDashOffset
Gets the current dash offset value.
public double CurrentDashOffset { get; }
Property Value
IsComplete
Gets whether the animation has completed.
public bool IsComplete { get; }
Property Value
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
deltaTimedoubleTime elapsed since last update in seconds.