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

#include <StringCurve.h>

+ Inheritance diagram for FStringCurve:

Public Member Functions

virtual ~FStringCurve ()
 
bool HasAnyData () const
 
ENGINE_API FKeyHandle AddKey (float InTime, const FString &InValue, FKeyHandle KeyHandle=FKeyHandle())
 
ENGINE_API void DeleteKey (FKeyHandle KeyHandle)
 
ENGINE_API FString Eval (float Time, const FString &InDefaultValue) const
 
ENGINE_API FKeyHandle FindKey (float KeyTime, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER) const
 
FString GetDefaultValue () const
 
ENGINE_API FStringCurveKeyGetKey (FKeyHandle KeyHandle)
 
ENGINE_API FStringCurveKey GetKey (FKeyHandle KeyHandle) const
 
const TArray< FStringCurveKey > & GetKeys () const
 
virtual ENGINE_API float GetKeyTime (FKeyHandle KeyHandle) const override final
 
ENGINE_API FString GetKeyValue (FKeyHandle KeyHandle) const
 
void SetDefaultValue (const FString &InDefaultValue)
 
void ClearDefaultValue ()
 
virtual ENGINE_API void SetKeyTime (FKeyHandle KeyHandle, float NewTime) override final
 
ENGINE_API void SetKeyValue (FKeyHandle KeyHandle, FString NewValue)
 
ENGINE_API FKeyHandle UpdateOrAddKey (float InTime, const FString &InValue, float KeyTimeTolerance=UE_KINDA_SMALL_NUMBER)
 
ENGINE_API void RemoveRedundantKeys ()
 
virtual int32 GetNumKeys () const override final
 
virtual FIndexedCurveDuplicate () const final
 
- Public Member Functions inherited from FIndexedCurve
 FIndexedCurve ()
 
virtual ~FIndexedCurve ()
 
ENGINE_API int32 GetIndexSafe (FKeyHandle KeyHandle) const
 
TArray< FKeyHandle >::TConstIterator GetKeyHandleIterator () const
 
ENGINE_API bool IsKeyHandleValid (FKeyHandle KeyHandle) const
 
FKeyHandle GetFirstKeyHandle () const
 
FKeyHandle GetLastKeyHandle () const
 
ENGINE_API FKeyHandle GetNextKey (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetPreviousKey (FKeyHandle KeyHandle) const
 
ENGINE_API void ShiftCurve (float DeltaTime)
 
ENGINE_API void ShiftCurve (float DeltaTime, const TSet< FKeyHandle > &KeyHandles)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor)
 
ENGINE_API void ScaleCurve (float ScaleOrigin, float ScaleFactor, const TSet< FKeyHandle > &KeyHandles)
 

Public Attributes

FString DefaultValue
 
TArray< FStringCurveKeyKeys
 
- Public Attributes inherited from FIndexedCurve
virtual int32 GetNumKeys () const PURE_VIRTUAL(FIndexedCurve
 
virtual void virtual SetKeyTime(FKeyHandle KeyHandle, float NewTime) PURE_VIRTUAL(FIndexedCurve float GetKeyTime (FKeyHandle KeyHandle) const PURE_VIRTUAL(FIndexedCurve
 
virtual FIndexedCurveDuplicate () const PURE_VIRTUAL(FIndexedCurve
 

Additional Inherited Members

- Protected Member Functions inherited from FIndexedCurve
void EnsureAllIndicesHaveHandles () const
 
void EnsureIndexHasAHandle (int32 KeyIndex) const
 
const int32FindIndex (FKeyHandle KeyHandle) const
 
ENGINE_API int32 GetIndex (FKeyHandle KeyHandle) const
 
ENGINE_API FKeyHandle GetKeyHandle (int32 KeyIndex) const
 
- Protected Attributes inherited from FIndexedCurve
FKeyHandleMap KeyHandlesToIndices
 

Detailed Description

Implements a curve of FStrings.

Constructor & Destructor Documentation

◆ ~FStringCurve()

virtual FStringCurve::~FStringCurve ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ AddKey()

FKeyHandle FStringCurve::AddKey ( float  InTime,
const FString &  InValue,
FKeyHandle  KeyHandle = FKeyHandle() 
)

Add a new key to the curve with the supplied Time and Value. Returns the handle of the new key.

Parameters
InTimeThe time at which to add the key.
InValueThe value of the key.
KeyHandleOptional handle for the new key.

◆ ClearDefaultValue()

void FStringCurve::ClearDefaultValue ( )
inline

Clears the default value for this curve if it has been set.

◆ DeleteKey()

void FStringCurve::DeleteKey ( FKeyHandle  KeyHandle)

Remove the specified key from the curve.

Parameters
KeyHandleHandle to the key to remove.

◆ Duplicate()

virtual FIndexedCurve * FStringCurve::Duplicate ( ) const
inlinefinalvirtual

Allocates a duplicate of the curve

◆ Eval()

FString FStringCurve::Eval ( float  Time,
const FString &  InDefaultValue 
) const

Evaluate the curve at the specified time.

Parameters
TimeThe time to evaluate.
InDefaultValueThe default value if no key exists.
Returns
The evaluated string.

◆ FindKey()

FKeyHandle FStringCurve::FindKey ( float  KeyTime,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
) const

Finds a key a the specified time.

Parameters
KeyTimeThe time at which to find the key.
KeyTimeToleranceThe key time tolerance to use for equality.
Returns
A handle to the key, or invalid key handle if not found.

◆ GetDefaultValue()

FString FStringCurve::GetDefaultValue ( ) const
inline

Get the default value for the curve

◆ GetKey() [1/2]

FStringCurveKey & FStringCurve::GetKey ( FKeyHandle  KeyHandle)

Get a key.

Parameters
KeyHandleThe handle of the key to get.
Returns
The key.

◆ GetKey() [2/2]

FStringCurveKey FStringCurve::GetKey ( FKeyHandle  KeyHandle) const

◆ GetKeys()

const TArray< FStringCurveKey > & FStringCurve::GetKeys ( ) const
inline

Read-only access to the key collection.

Returns
Collection of keys.

◆ GetKeyTime()

float FStringCurve::GetKeyTime ( FKeyHandle  KeyHandle) const
finaloverridevirtual

Get the time for the Key with the specified index.

Parameters
KeyHandleHandle to the key whose time to get.
Returns
The key's time.

◆ GetKeyValue()

FString FStringCurve::GetKeyValue ( FKeyHandle  KeyHandle) const

Get the value for the Key with the specified index.

Parameters
KeyHandleHandle to the key whose value to get.
Returns
The key's value.

◆ GetNumKeys()

virtual int32 FStringCurve::GetNumKeys ( ) const
inlinefinaloverridevirtual

◆ HasAnyData()

bool FStringCurve::HasAnyData ( ) const
inline

Check whether this curve has any data or not

◆ RemoveRedundantKeys()

void FStringCurve::RemoveRedundantKeys ( )

Tries to reduce the number of keys required for accurate evaluation (removing duplicates)

◆ SetDefaultValue()

void FStringCurve::SetDefaultValue ( const FString &  InDefaultValue)
inline

Set the default value of the curve.

Parameters
InDefaultValueThe value to set.

◆ SetKeyTime()

void FStringCurve::SetKeyTime ( FKeyHandle  KeyHandle,
float  NewTime 
)
finaloverridevirtual

Move a key to a new time.

Parameters
KeyHandleThe handle of the key to change.
NewTimeThe new time to set on the key.

◆ SetKeyValue()

void FStringCurve::SetKeyValue ( FKeyHandle  KeyHandle,
FString  NewValue 
)

Assign a new value to a key.

Parameters
KeyHandleThe handle of the key to change.
NewTimeThe new value to set on the key.

◆ UpdateOrAddKey()

FKeyHandle FStringCurve::UpdateOrAddKey ( float  InTime,
const FString &  InValue,
float  KeyTimeTolerance = UE_KINDA_SMALL_NUMBER 
)

Finds the key at InTime, and updates its value. If it can't find the key within the KeyTimeTolerance, it adds one at that time.

Parameters
InTimeThe time at which the key should be added or updated.
InValueThe value of the key.
KeyTimeToleranceThe tolerance used for key time equality.

Member Data Documentation

◆ DefaultValue

FString FStringCurve::DefaultValue

Default value

◆ Keys

TArray<FStringCurveKey> FStringCurve::Keys

Sorted array of keys


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