![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <AlphaBlend.h>
Public Member Functions | |
| ENGINE_API | FAlphaBlend (float NewBlendTime=0.2f) |
| ENGINE_API | FAlphaBlend (const FAlphaBlend &Other, float NewBlendTime) |
| bool | Serialize (FArchive &Ar) |
| bool | Serialize (FStructuredArchive::FSlot Slot) |
| ENGINE_API | FAlphaBlend (const FAlphaBlendArgs &InArgs) |
| ENGINE_API void | SetBlendOption (EAlphaBlendOption InBlendOption) |
| ENGINE_API void | SetCustomCurve (UCurveFloat *InCustomCurve) |
| ENGINE_API void | SetBlendTime (float InBlendTime) |
| ENGINE_API void | SetValueRange (float Begin, float Desired) |
| ENGINE_API void | SetDesiredValue (float InDesired) |
| ENGINE_API void | SetAlpha (float InAlpha) |
| ENGINE_API float | Update (float InDeltaTime) |
| ENGINE_API bool | IsComplete () const |
| float | GetAlpha () const |
| float | GetBlendedValue () const |
| float | GetBlendTime () const |
| float | GetBlendTimeRemaining () const |
| EAlphaBlendOption | GetBlendOption () const |
| UCurveFloat * | GetCustomCurve () const |
| float | GetBeginValue () const |
| float | GetDesiredValue () const |
| ENGINE_API void | Reset () |
| ENGINE_API void | ResetAlpha () |
Static Public Member Functions | |
| static ENGINE_API float | AlphaToBlendOption (float InAlpha, EAlphaBlendOption InBlendOption, UCurveFloat *InCustomCurve=nullptr) |
Alpha Blend class that supports different blend options as well as custom curves
| FAlphaBlend::FAlphaBlend | ( | float | NewBlendTime = 0.2f | ) |
| FAlphaBlend::FAlphaBlend | ( | const FAlphaBlend & | Other, |
| float | NewBlendTime | ||
| ) |
|
explicit |
|
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
|
inline |
Get the current begin value
|
inline |
Gets the current blended value
|
inline |
|
inline |
Getters
|
inline |
|
inline |
|
inline |
Get the current desired value
| bool FAlphaBlend::IsComplete | ( | ) | const |
Gets whether or not the blend is complete
| 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::ResetAlpha | ( | ) |
Reset alpha, this keeps current BlendedValue but modify Alpha to keep the blending state.
| bool FAlphaBlend::Serialize | ( | FStructuredArchive::FSlot | Slot | ) |
Sets the Lerp alpha value directly. PLEASE NOTE that this modifies the Blended Value right away.
note this function can modify BlendedValue right away
| void FAlphaBlend::SetBlendOption | ( | EAlphaBlendOption | InBlendOption | ) |
Setters - need to refresh cached value
Update transition blend time. This new value will be applied in the next Update.
| void FAlphaBlend::SetCustomCurve | ( | UCurveFloat * | InCustomCurve | ) |
Sets the final desired value for the blended value
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
Update interpolation, has to be called once every frame.