Class NodeScaleAnimation
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
nodeNodestartScaledoubleendScaledoubledurationdoubleeasingFunc<double, double>onUpdateAction<Node, double>onCompleteAction
Properties
CurrentScale
Gets the current scale value.
public double CurrentScale { 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()
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
Returns
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
Returns
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.