UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAlphaBlend Struct Reference

#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
 
UCurveFloatGetCustomCurve () 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)
 

Detailed Description

Alpha Blend class that supports different blend options as well as custom curves

Constructor & Destructor Documentation

◆ FAlphaBlend() [1/3]

FAlphaBlend::FAlphaBlend ( float  NewBlendTime = 0.2f)

◆ FAlphaBlend() [2/3]

FAlphaBlend::FAlphaBlend ( const FAlphaBlend Other,
float  NewBlendTime 
)

◆ FAlphaBlend() [3/3]

FAlphaBlend::FAlphaBlend ( const FAlphaBlendArgs InArgs)
explicit

Member Function Documentation

◆ AlphaToBlendOption()

float FAlphaBlend::AlphaToBlendOption ( float  InAlpha,
EAlphaBlendOption  InBlendOption,
UCurveFloat InCustomCurve = nullptr 
)
static

Converts InAlpha from a linear 0...1 value into the output alpha described by InBlendOption

Parameters
InAlphaIn linear 0...1 alpha
InBlendOptionThe type of blend to use
InCustomCurveThe curve to use when blend option is set to custom

◆ GetAlpha()

float FAlphaBlend::GetAlpha ( ) const
inline

Gets the current 0..1 alpha value. Changed to AlphaLerp to match with SetAlpha function

◆ GetBeginValue()

float FAlphaBlend::GetBeginValue ( ) const
inline

Get the current begin value

◆ GetBlendedValue()

float FAlphaBlend::GetBlendedValue ( ) const
inline

Gets the current blended value

◆ GetBlendOption()

EAlphaBlendOption FAlphaBlend::GetBlendOption ( ) const
inline

◆ GetBlendTime()

float FAlphaBlend::GetBlendTime ( ) const
inline

Getters

◆ GetBlendTimeRemaining()

float FAlphaBlend::GetBlendTimeRemaining ( ) const
inline

◆ GetCustomCurve()

UCurveFloat * FAlphaBlend::GetCustomCurve ( ) const
inline

◆ GetDesiredValue()

float FAlphaBlend::GetDesiredValue ( ) const
inline

Get the current desired value

◆ IsComplete()

bool FAlphaBlend::IsComplete ( ) const

Gets whether or not the blend is complete

◆ Reset()

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.

◆ ResetAlpha()

void FAlphaBlend::ResetAlpha ( )

Reset alpha, this keeps current BlendedValue but modify Alpha to keep the blending state.

◆ Serialize() [1/2]

bool FAlphaBlend::Serialize ( FArchive Ar)

◆ Serialize() [2/2]

bool FAlphaBlend::Serialize ( FStructuredArchive::FSlot  Slot)

◆ SetAlpha()

void FAlphaBlend::SetAlpha ( float  InAlpha)

Sets the Lerp alpha value directly. PLEASE NOTE that this modifies the Blended Value right away.

note this function can modify BlendedValue right away

◆ SetBlendOption()

void FAlphaBlend::SetBlendOption ( EAlphaBlendOption  InBlendOption)

Setters - need to refresh cached value

◆ SetBlendTime()

void FAlphaBlend::SetBlendTime ( float  InBlendTime)

Update transition blend time. This new value will be applied in the next Update.

◆ SetCustomCurve()

void FAlphaBlend::SetCustomCurve ( UCurveFloat InCustomCurve)

◆ SetDesiredValue()

void FAlphaBlend::SetDesiredValue ( float  InDesired)

Sets the final desired value for the blended value

◆ SetValueRange()

void FAlphaBlend::SetValueRange ( float  Begin,
float  Desired 
)

Sets the range of values to map to the interpolation

Parameters
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()

float FAlphaBlend::Update ( float  InDeltaTime)

Update interpolation, has to be called once every frame.

Returns
How much time remains after the blend completed if applicable e.g. if we have 0.01s left on the blend and update at 30Hz (~0.033s) we would return ~0.023s

The documentation for this struct was generated from the following files: