Table of Contents

Class NodeScaleAnimation

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

Animates a node's scale for pop/shrink effects.

public class NodeScaleAnimation : IAnimation
Inheritance
NodeScaleAnimation
Implements
Inherited Members

Constructors

NodeScaleAnimation(Node, double, double, double, Func<double, double>?, Action<Node, double>?, Action?)

Creates a new node scale animation.

public NodeScaleAnimation(Node node, double startScale, double endScale, double duration = 0.3, Func<double, double>? easing = null, Action<Node, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node
startScale double
endScale double
duration double
easing Func<double, double>
onUpdate Action<Node, double>
onComplete Action

Properties

CurrentScale

Gets the current scale value.

public double CurrentScale { get; }

Property Value

double

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()

PopIn(Node, double, Action<Node, double>?, Action?)

Creates a "pop in" animation (scale from small to normal with overshoot).

public static NodeScaleAnimation PopIn(Node node, double duration = 0.3, Action<Node, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node
duration double
onUpdate Action<Node, double>
onComplete Action

Returns

NodeScaleAnimation

ShrinkOut(Node, double, Action<Node, double>?, Action?)

Creates a "shrink out" animation (scale from normal to small).

public static NodeScaleAnimation ShrinkOut(Node node, double duration = 0.2, Action<Node, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node
duration double
onUpdate Action<Node, double>
onComplete Action

Returns

NodeScaleAnimation

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.