Class FloatAnimationWorkAction
Executes an action on a single float value.
Implements
Inherited Members
Namespace: Evergine.Components.WorkActions
Assembly: Evergine.Components.dll
Syntax
public class FloatAnimationWorkAction : UpdatableWorkAction, IWorkAction
Constructors
FloatAnimationWorkAction(Entity, float, float, TimeSpan, EaseFunction)
Initializes a new instance of the FloatAnimationWorkAction class.
Declaration
protected FloatAnimationWorkAction(Entity entity, float from, float to, TimeSpan time, EaseFunction ease)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
float | from | Initial value. |
float | to | End value. |
TimeSpan | time | The duration of the animation. |
EaseFunction | ease | Easing function. |
FloatAnimationWorkAction(Entity, float, float, TimeSpan, EaseFunction, Action<float>)
Initializes a new instance of the FloatAnimationWorkAction class.
Declaration
public FloatAnimationWorkAction(Entity entity, float from, float to, TimeSpan time, EaseFunction ease, Action<float> updateAction)
Parameters
Type | Name | Description |
---|---|---|
Entity | entity | The entity. |
float | from | Initial value. |
float | to | End value. |
TimeSpan | time | The duration of the animation. |
EaseFunction | ease | Easing function. |
Action<float> | updateAction | The action when it needs to be updated. |
Fields
from
Initial value.
Declaration
protected float from
Field Value
Type | Description |
---|---|
float |
to
End value.
Declaration
protected float to
Field Value
Type | Description |
---|---|
float |
updateAction
The update action.
Declaration
protected Action<float> updateAction
Field Value
Type | Description |
---|---|
Action<float> |
Methods
BackInEase(float, float, float, float)
Back in ease function.
Declaration
public float BackInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
BackInOutEase(float, float, float, float)
Back in and out ease function.
Declaration
public float BackInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
BackOutEase(float, float, float, float)
Back out ease function.
Declaration
public float BackOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Starting value. |
float | c | Ending value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
BounceInEase(float, float, float, float)
Bounce in ease function.
Declaration
public float BounceInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Starting value. |
float | c | Ending value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
BounceInOutEase(float, float, float, float)
Bounce in and out ease function.
Declaration
public float BounceInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
BounceOutEase(float, float, float, float)
Bounce out ease function.
Declaration
public float BounceOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CircleInEase(float, float, float, float)
Circle-in ease function.
Declaration
public float CircleInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CircleInOutEase(float, float, float, float)
Circle in and out ease function.
Declaration
public float CircleInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CircleOutEase(float, float, float, float)
Circle out ease function.
Declaration
public float CircleOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CubicInEase(float, float, float, float)
Cubic in ease function.
Declaration
public float CubicInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CubicInOutEase(float, float, float, float)
Cubic in and out ease function.
Declaration
public float CubicInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
CubicOutEase(float, float, float, float)
Cubic out ease function.
Declaration
public float CubicOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
DeltaFunction(EaseFunction, float, float, float, float)
Delta function method.
Declaration
public float DeltaFunction(EaseFunction function, float from, float to, float time, float totalTime)
Parameters
Type | Name | Description |
---|---|---|
EaseFunction | function | Function. |
float | from | Start value. |
float | to | End value. |
float | time | Current time. |
float | totalTime | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ElasticInEase(float, float, float, float)
Elastic in ease function.
Declaration
public float ElasticInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ElasticInOutEase(float, float, float, float)
Elastic in and out ease function.
Declaration
public float ElasticInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ElasticOutEase(float, float, float, float)
Elastic out ease function.
Declaration
public float ElasticOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ExponentialInEase(float, float, float, float)
Exponential in ease function.
Declaration
public float ExponentialInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ExponentialInOutEase(float, float, float, float)
Exponential in and out ease function.
Declaration
public float ExponentialInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
ExponentialOutEase(float, float, float, float)
Exponential out ease function.
Declaration
public float ExponentialOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
LinearStep(float, float, float)
Smooth Step method.
Declaration
public float LinearStep(float from, float to, float lerp)
Parameters
Type | Name | Description |
---|---|---|
float | from | Initial value. |
float | to | End value. |
float | lerp | The interpolation value. |
Returns
Type | Description |
---|---|
float | The calculated value. |
PerformCancel()
Cancels the work action.
Declaration
protected override void PerformCancel()
Overrides
PerformRun()
On the run.
Declaration
protected override void PerformRun()
Overrides
PerformSkip()
Notifies the skip.
Declaration
protected override bool PerformSkip()
Returns
Type | Description |
---|---|
bool | True if the action is skipped successfully. |
Overrides
QuadraticInEase(float, float, float, float)
Quadratic easing-in function.
Declaration
public float QuadraticInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuadraticInOutEase(float, float, float, float)
Quadratic in and out ease function.
Declaration
public float QuadraticInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuadraticOutEase(float, float, float, float)
Quadratic out ease function.
Declaration
public float QuadraticOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuarticInEase(float, float, float, float)
Quartic in ease function.
Declaration
public float QuarticInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuarticInOutEase(float, float, float, float)
Quartic in and out ease function.
Declaration
public float QuarticInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuarticOutEase(float, float, float, float)
Quartic out ease function.
Declaration
public float QuarticOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuinticInEase(float, float, float, float)
Quintic in ease function.
Declaration
public float QuinticInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuinticInOutEase(float, float, float, float)
Quintic in and out ease function.
Declaration
public float QuinticInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
QuinticOutEase(float, float, float, float)
Quintic out ease function.
Declaration
public float QuinticOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
SineInEase(float, float, float, float)
Sine in ease function.
Declaration
public float SineInEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
SineInOutEase(float, float, float, float)
Sine in and out ease function.
Declaration
public float SineInOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
SineOutEase(float, float, float, float)
Sine out ease function.
Declaration
public float SineOutEase(float t, float b, float c, float d)
Parameters
Type | Name | Description |
---|---|---|
float | t | Current time. |
float | b | Start value. |
float | c | End value. |
float | d | Animation duration. |
Returns
Type | Description |
---|---|
float | Delta value. |
Update(TimeSpan)
Updates the single work action.
Declaration
public override void Update(TimeSpan gameTime)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | gameTime | The elapsed game time. |