Alpha Blend class that supports different blend options as well as custom curves 更多...
#include <AlphaBlend.h>
Public 成员函数 | |
| float | GetAlpha () const |
| Gets the current 0..1 alpha value. 更多... | |
| float | GetBeginValue () const |
| Get the current begin value | |
| float | GetBlendedValue () const |
| Gets the current blended value | |
| float | GetBlendTime () const |
| Getters | |
| float | GetDesiredValue () const |
| Get the current desired value | |
| bool | IsComplete () const |
| Gets whether or not the blend is complete | |
| void | Reset () |
| Reset functions - 更多... | |
| void | SetAlpha (float InAlpha) |
| Sets the Lerp alpha value directly. 更多... | |
| void | SetBlendOption (EAlphaBlendOption InBlendOption) |
| Setters - need to refresh cached value | |
| void | SetBlendTime (float InBlendTime) |
| Update transition blend time. 更多... | |
| void | SetDesiredValue (float InDesired) |
| Sets the final desired value for the blended value | |
| void | SetValueRange (float Begin, float Desired) |
| Sets the range of values to map to the interpolation 更多... | |
| float | Update (float InDeltaTime) |
| Update interpolation, has to be called once every frame. 更多... | |
静态 Public 成员函数 | |
| static float | AlphaToBlendOption (float InAlpha, EAlphaBlendOption InBlendOption, UCurveFloat *InCustomCurve=nullptr) |
| Converts InAlpha from a linear 0...1 value into the output alpha described by InBlendOption 更多... | |
Alpha Blend class that supports different blend options as well as custom curves
|
static |
Converts InAlpha from a linear 0...1 value into the output alpha described by InBlendOption
| InAlpha | In linear 0...1 alpha |
| InBlendOption | The type of blend to use |
| InCustomCurve | The curve to use when blend option is set to custom |
|
inline |
Gets the current 0..1 alpha value.
Changed to AlphaLerp to match with SetAlpha function
| void FAlphaBlend::Reset | ( | ) |
Reset functions -
The distinction is important.
We have 3 different reset functions depending on usability
Reset function : will change Blended Value to BeginValue, so that it can start blending That is only supposed to be used when you want to clear it up and restart
ResetAlpha will change AlphaLerp/AlphaBlend to match with current Blend Value, that way we keep the current blended value and move to target using the current value That will make sure this doesn't pop when you change direction of Desired
ResetBlendTime will change BlendTimeRemaining as well as possibly weight because if BlendTimeRemaining <= 0.f, We'll arrive to the destination
The reason we need ResetAlpha and ResetBlendTime is that we don't want to modify blend time if direction changes or we don't want to reset alpha if blend time changes Those two have to work independently Reset to zero / restart the blend. This resets whole thing.
| void FAlphaBlend::SetAlpha | ( | float | InAlpha | ) |
Sets the Lerp alpha value directly.
PLEASE NOTE that this modifies the Blended Value right away.
| void FAlphaBlend::SetBlendTime | ( | float | InBlendTime | ) |
Update transition blend time.
This new value will be applied in the next Update.
| void FAlphaBlend::SetValueRange | ( | float | Begin, |
| float | Desired | ||
| ) |
Sets the range of values to map to the interpolation
| Begin | : this is start value |
| Desired | : this is target value |
This can be (0, 1) if you'd like to increase, or it can be (1, 0) if you'd like to get to 0
| float FAlphaBlend::Update | ( | float | InDeltaTime | ) |
Update interpolation, has to be called once every frame.