Class Easings
Definition
Namespace: StardewUI.Animation
Assembly: StardewUI.dll
Common registration and lookup for easing functions.
Inheritance
Object ⇦ Easings
Members
Methods
Name | Description |
---|---|
Add(string, Easing) | Registers a new easing, if one with the same name is not already registered. |
CubicBezier(Single, Single, Single, Single) | Creates a Cubic Bézier (AKA key spline) easing from two control points. |
Named(string) | Retrieves an easing function, given its registered name. |
Parse(string) | Parses an Easing value from a string value. |
Parse(ReadOnlySpan<Char>) | Parses an Easing value from a string value. |
TryParse(ReadOnlySpan<Char>, Easing) | Attempts to parse an Easing value from a string value. |
Details
Methods
Add(string, Easing)
Registers a new easing, if one with the same name is not already registered.
Parameters
name
string
The name of the easing function.
easing
Easing
The easing function.
Remarks
If an easing with the specified name
already exists, the call is ignored.
CubicBezier(float, float, float, float)
Creates a Cubic Bézier (AKA key spline) easing from two control points.
Parameters
x1
Single
The X value of the first control point.
y1
Single
The Y value of the first control point.
x2
Single
The X value of the second control point.
y2
Single
The Y value of the second control point.
Returns
The easing function described by the control points.
Named(string)
Retrieves an easing function, given its registered name.
Parameters
name
string
An easing function name, such as EaseOutCubic
.
Returns
The easing function registered with the specified name
, or null
if no such function was registered.
Parse(string)
Parses an Easing value from a string value.
Parameters
value
string
The string value to parse.
Returns
The parsed easing function.
Parse(ReadOnlySpan<Char>)
Parses an Easing value from a string value.
Parameters
value
ReadOnlySpan<Char>
The string value to parse.
Returns
The parsed easing function.
TryParse(ReadOnlySpan<Char>, Easing)
Attempts to parse an Easing value from a string value.
public static bool TryParse(ReadOnlySpan<System.Char> value, out StardewUI.Animation.Easing result);
Parameters
value
ReadOnlySpan<Char>
The string value to parse.
result
Easing
The parsed easing function, if successful; otherwise null
.
Returns
true
if the value
was parsed successfully, otherwise false
.
Remarks
Works with both named easings, and known easing functions like CubicBezier
.