Class Transition
Definition
Namespace: StardewUI.Animation
Assembly: StardewUI.dll
Describes the transition behavior of a single property.
Inheritance
Object ⇦ Transition
Implements
IEquatable<Transition>
Members
Constructors
Name | Description |
---|---|
Transition(TimeSpan, TimeSpan, Easing) | Describes the transition behavior of a single property. |
Transition(TimeSpan?, TimeSpan?, Easing) | Initializes a new Transition instance. |
Fields
Name | Description |
---|---|
Default | A Transition instance with all values set to their defaults. |
DefaultDelay | Default delay (zero) for transitions not specifying an explicit delay. |
DefaultDuration | Default duration (1 second) for transitions not specifying an explicit duration. |
DefaultEasing | Default easing (linear) for transitions not specifying an explicit easing function. |
Properties
Name | Description |
---|---|
Delay | Delay during which to hold the current value before transitioning to the new value. |
Duration | Duration of the transition. |
Easing | Type of easing or acceleration curve for the transition. |
EqualityContract | |
TotalDuration | The total duration of the transition, including both the animation itself and any pre-delay. |
Methods
Name | Description |
---|---|
GetPosition(TimeSpan) | Computes the interpolation position for this transition, given the time elapsed since the transition was first triggered. |
Parse(string) | Parses a Transition value from a string value. |
Parse(ReadOnlySpan<Char>) | Parses a Transition value from a string value. |
TryParse(ReadOnlySpan<Char>, Transition) | Attempts to parse a Transition value from a string value. |
Details
Constructors
Transition(TimeSpan, TimeSpan, Easing)
Describes the transition behavior of a single property.
public Transition(System.TimeSpan Duration, System.TimeSpan Delay, StardewUI.Animation.Easing Easing);
Parameters
Duration
TimeSpan
Duration of the transition.
Delay
TimeSpan
Delay during which to hold the current value before transitioning to the new value.
Easing
Easing
Type of easing or acceleration curve for the transition.
Transition(TimeSpan?, TimeSpan?, Easing)
Initializes a new Transition instance.
public Transition(System.TimeSpan? duration, System.TimeSpan? delay, StardewUI.Animation.Easing easing);
Parameters
duration
Nullable<TimeSpan>
Duration of the transition. If not specified, the transition will use the DefaultDuration.
delay
Nullable<TimeSpan>
Delay during which to hold the current value before transitioning to the new value. If not specified, the transition will use the DefaultDelay.
easing
Easing
Type of easing or acceleration curve for the transition. If not specified, the transition will use the DefaultEasing.
Fields
Default
A Transition instance with all values set to their defaults.
Field Value
DefaultDelay
Default delay (zero) for transitions not specifying an explicit delay.
Field Value
DefaultDuration
Default duration (1 second) for transitions not specifying an explicit duration.
Field Value
DefaultEasing
Default easing (linear) for transitions not specifying an explicit easing function.
Field Value
Properties
Delay
Delay during which to hold the current value before transitioning to the new value.
Property Value
Duration
Duration of the transition.
Property Value
Easing
Type of easing or acceleration curve for the transition.
Property Value
EqualityContract
Property Value
TotalDuration
The total duration of the transition, including both the animation itself and any pre-delay.
Property Value
Methods
GetPosition(TimeSpan)
Computes the interpolation position for this transition, given the time elapsed since the transition was first triggered.
Parameters
elapsed
TimeSpan
Time elapsed since the transition was initiated.
Returns
The interpolation amount or "y position" at the specified time.
Remarks
The value is independent of the type of property being transitioned, or how it is interpolated; the result is intended to be used as the amount
argument to a Lerp<T> delegate.
Parse(string)
Parses a Transition value from a string value.
Parameters
value
string
The string value to parse.
Returns
The parsed transition.
Parse(ReadOnlySpan<Char>)
Parses a Transition value from a string value.
Parameters
value
ReadOnlySpan<Char>
The string value to parse.
Returns
The parsed transition.
TryParse(ReadOnlySpan<Char>, Transition)
Attempts to parse a Transition value from a string value.
public static bool TryParse(ReadOnlySpan<System.Char> value, out StardewUI.Animation.Transition result);
Parameters
value
ReadOnlySpan<Char>
The string value to parse.
result
Transition
The parsed transition, if successful; otherwise null
.
Returns
true
if the value
was parsed successfully, otherwise false
.