GH_FadeAnimation

public class GH_FadeAnimation
Utility class for animating fade ZUI events on the canvas.

Constructors

GH_FadeAnimation

#
public GH_FadeAnimation()
Creates a new instance of the Animator class with default settings.

GH_FadeAnimation

#
public GH_FadeAnimation(float threshold, int duration)
Create a new instance of the Animator class with custom values for zoom threshold and duration.
threshold (float)Zoom threshold at which the animation kicks in. The default is 2.0
duration (int)The duration (in milliseconds) of the fade animation, the default is 350

GH_FadeAnimation

#
public GH_FadeAnimation(float threshold)
Create a new instance of the Animator class with custom values for zoom threshold.
threshold (float)Zoom threshold at which the animation kicks in. The default is 2.0

Fields

Delay

#
public const int Delay = 25
Gets the number of milliseconds between redraws (25 milliseconds, resulting in ~40 fps)

Properties

Duration

#
public int Duration { get; set; }
Gets or sets the duration (in milliseconds) for ZUI animations. Negative durations are not allowed. The default is 350 milliseconds.

FadeAlpha

#
public int FadeAlpha { get; }
Gets the blend alpha byte for the current state. 0 means fully hidden, 255 means fully shown.

FadeFactor

#
public double FadeFactor { get; }
Gets the blend factor for the current state. 0.0 means fully hidden, 1.0 means fully shown.

IsFinished

#
public bool IsFinished { get; }
Gets a value indicating whether this animator has finished animating.

Phase

#
public GH_FadePhase Phase { get; }
Gets the current animation phase.

Threshold

#
public float Threshold { get; set; }
Gets or sets the threshold value for the fade animation trigger.

TriggerUpdate

#
public bool TriggerUpdate { get; set; }
Gets or sets whether this animator triggers canvas updates.

Methods

Evaluate

#
public void Evaluate(GH_Canvas canvas, bool scheduleRedraw)
Reevaluate the fade animation parameters. You should call this method from within the Render method of your attributes. If an animation is currently in progress a redraw of the canvas will be scheduled, whether or not the attributes are actually visible on the canvas. You should therefore only call this method if your attributes are already drawing themselves.
canvas (GH_Canvas)Canvas currently drawing in.
scheduleRedraw (bool)If true and the animator is active, a redraw will be scheduled.

Evaluate

#
public void Evaluate(GH_Canvas canvas, float value, bool scheduleRedraw)
Reevaluate the fade animation parameters. You should call this method from within the Render method of your attributes. If an animation is currently in progress a redraw of the canvas will be scheduled, whether or not the attributes are actually visible on the canvas. You should therefore only call this method if your attributes are already drawing themselves.
canvas (GH_Canvas)Canvas currently drawing in.
value (float)
scheduleRedraw (bool)If true and the animator is active, a redraw will be scheduled.

Evaluate

#
public void Evaluate(GH_Canvas canvas, float value)
Reevaluate the fade animation parameters. You should call this method from within the Render method of your attributes. If an animation is currently in progress a redraw of the canvas will be scheduled, whether or not the attributes are actually visible on the canvas. You should therefore only call this method if your attributes are already drawing themselves.
canvas (GH_Canvas)Canvas currently drawing in.
value (float)

Evaluate

#
public void Evaluate(GH_Canvas canvas)
Reevaluate the fade animation parameters. You should call this method from within the Render method of your attributes. If an animation is currently in progress a redraw of the canvas will be scheduled, whether or not the attributes are actually visible on the canvas. You should therefore only call this method if your attributes are already drawing themselves.
canvas (GH_Canvas)Canvas currently drawing in.