Class AnimationExtensions
A set of extension methods for doing convenient animation things.
Inherited Members
Namespace: Ritchie.Toolbox.Animation
Assembly: Ritchie.Toolbox.dll
Syntax
public static class AnimationExtensions
Methods
RenderOpacityFade(Widget, float, float, CurveFunction?)
Create an animated fade of a Widget's visual opacity.
Declaration
public static IAnimationHandle RenderOpacityFade(this Widget widget, float targetOpacity, float duration, CurveFunction? curve = null)
Parameters
Type | Name | Description |
---|---|---|
Widget | widget | The widget to animate. |
float | targetOpacity | A target value to transition the widget's visual opacity to. |
float | duration | The length of the fade transition, in seconds. |
CurveFunction | curve | A CurveFunction to use for the fade transition. If none is provided, Linear will be used. |
Returns
Type | Description |
---|---|
IAnimationHandle | An IAnimationHandle for the transition. |
WhileActive<T>(IAnimationHandle, T, Action<T>)
Continuously perform an action on a subject each time an animation is updated.
Declaration
public static IAnimationHandle WhileActive<T>(this IAnimationHandle animation, T subject, Action<T> predicate)
Parameters
Type | Name | Description |
---|---|---|
IAnimationHandle | animation | The animation on which to add the subject update action. |
T | subject | Any object on which you would like to call a method or update a property. |
Action<T> | predicate | Code to execute each time the animation is updated. The provided |
Returns
Type | Description |
---|---|
IAnimationHandle |
Type Parameters
Name | Description |
---|---|
T | Any type. |