Skip to content

Class Animator

Definition

Namespace: StardewUI.Animation
Assembly: StardewUI.dll

Helpers for creating typed Animator<T, V> instances.

public static class Animator

Inheritance
Object ⇦ Animator

Members

Methods

Name Description
On<T, V>(T, Func<T, V>, Lerp<V>, Action<T, V>) Creates a new Animator<T, V>.
On<T>(T, Func<T, Single>, Action<T, Single>) Creates a new Animator<T, V> that animates a standard Single property.

Details

Methods

On<T, V>(T, Func<T, V>, Lerp<V>, Action<T, V>)

Creates a new Animator<T, V>.

public static StardewUI.Animation.Animator<T, V> On<T, V>(T target, Func<T, V> getValue, StardewUI.Animation.Lerp<V> lerpValue, Action<T, V> setValue);
Parameters

target   T
The object whose property will be animated.

getValue   Func<T, V>
Function to get the current value. Used for animations that don't explicit specify a start value, e.g. when using the Start(Animation<V>) overload.

lerpValue   Lerp<V>
Function to linearly interpolate between the start and end values.

setValue   Action<T, V>
Delegate to set the value on the target.

Returns

Animator<T, V>

Remarks

Calling this is the same as calling the constructor, but typically does not require explicit type arguments.


On<T>(T, Func<T, Single>, Action<T, Single>)

Creates a new Animator<T, V> that animates a standard Single property.

public static StardewUI.Animation.Animator<T, System.Single> On<T>(T target, Func<T, System.Single> getValue, Action<T, System.Single> setValue);
Parameters

target   T
The object whose property will be animated.

getValue   Func<T, Single>
Function to get the current value. Used for animations that don't explicit specify a start value, e.g. when using the Start(Animation<V>) overload.

setValue   Action<T, Single>
Delegate to set the value on the target.

Returns

Animator<T, Single>

Remarks

Calling this is the same as calling the constructor, but typically does not require explicit type arguments.