engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 所有成员列表
FAlphaBlend结构体 参考

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

成员函数说明

◆ AlphaToBlendOption()

static 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

参数
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

◆ 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.

◆ SetAlpha()

void FAlphaBlend::SetAlpha ( float  InAlpha)

Sets the Lerp alpha value directly.

PLEASE NOTE that this modifies the Blended Value right away.

◆ SetBlendTime()

void FAlphaBlend::SetBlendTime ( float  InBlendTime)

Update transition blend time.

This new value will be applied in the next Update.

◆ SetValueRange()

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

◆ Update()

float FAlphaBlend::Update ( float  InDeltaTime)

Update interpolation, has to be called once every frame.

返回
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

该结构体的文档由以下文件生成: