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

#include <CurveSequence.h>

+ Inheritance diagram for FCurveSequence:

Classes

struct  FSlateCurve
 

Public Member Functions

SLATECORE_API FCurveSequence ()
 
SLATECORE_API ~FCurveSequence ()
 
SLATECORE_API FCurveSequence (const float InStartTimeSeconds, const float InDurationSeconds, const ECurveEaseFunction InEaseFunction=ECurveEaseFunction::Linear)
 
SLATECORE_API FCurveHandle AddCurve (const float InStartTimeSeconds, const float InDurationSeconds, const ECurveEaseFunction InEaseFunction=ECurveEaseFunction::Linear)
 
SLATECORE_API FCurveHandle AddCurveRelative (const float InOffset, const float InDurationSecond, const ECurveEaseFunction InEaseFunction=ECurveEaseFunction::Linear)
 
SLATECORE_API void Play (const TSharedRef< SWidget > &InOwnerWidget, bool bPlayLooped=false, const float StartAtTime=0.0f, bool bRequiresActiveTimer=true)
 
SLATECORE_API void Play (const FTickerDelegate &InDelegate, bool bPlayLooped=false, const float StartAtTime=0.0f)
 
SLATECORE_API void PlayReverse (const TSharedRef< SWidget > &InOwnerWidget, bool bPlayLooped=false, const float StartAtTime=0.0f, bool bRequiresActiveTimer=true)
 
SLATECORE_API void Reverse ()
 
SLATECORE_API void Pause ()
 
SLATECORE_API void Resume ()
 
SLATECORE_API void PlayRelative (const TSharedRef< SWidget > &InOwnerWidget, bool bForward)
 
SLATECORE_API bool IsPlaying () const
 
SLATECORE_API float GetSequenceTime () const
 
SLATECORE_API bool IsInReverse () const
 
SLATECORE_API bool IsForward () const
 
SLATECORE_API void JumpToStart ()
 
SLATECORE_API void JumpToEnd ()
 
SLATECORE_API bool IsAtStart () const
 
SLATECORE_API bool IsAtEnd () const
 
SLATECORE_API bool IsLooping () const
 
SLATECORE_API float GetLerp () const
 
SLATECORE_API const FCurveSequence::FSlateCurveGetCurve (int32 CurveIndex) const
 
- Public Member Functions inherited from TSharedFromThis< FCurveSequence >
TSharedRef< FCurveSequence, Mode > AsShared ()
 
TSharedRef< FCurveSequence const, Mode > AsShared () const
 
TSharedRef< SubobjectType, Mode > AsSharedSubobject (SubobjectType *SubobjectPtr) const
 
TWeakPtr< FCurveSequence, Mode > AsWeak ()
 
TWeakPtr< FCurveSequence const, Mode > AsWeak () const
 
TWeakPtr< SubobjectType, Mode > AsWeakSubobject (SubobjectType *SubobjectPtr) const
 
void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, SharedPtrMode > const *InSharedPtr, OtherType *InObject) const
 
void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, SharedPtrMode > const *InSharedRef, OtherType *InObject) const
 
UE_FORCEINLINE_HINT bool DoesSharedInstanceExist () const
 

Protected Member Functions

SLATECORE_API void SetStartTime (double InStartTime)
 
- Protected Member Functions inherited from TSharedFromThis< FCurveSequence >
 TSharedFromThis ()
 
 TSharedFromThis (TSharedFromThis const &)
 
UE_FORCEINLINE_HINT TSharedFromThisoperator= (TSharedFromThis const &)
 
 ~TSharedFromThis ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from TSharedFromThis< FCurveSequence >
static UE_FORCEINLINE_HINT TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 
static UE_FORCEINLINE_HINT TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 

Detailed Description

A sequence of curves that can be used to drive animations for slate widgets. Active timer registration is handled for the widget being animated when calling play.

Each curve within the sequence has a time offset and a duration. This makes FCurveSequence convenient for crating staggered animations. e.g. // We want to zoom in a widget, and then fade in its contents. FCurveHandle ZoomCurve = Sequence.AddCurve( 0, 0.15f ); FCurveHandle FadeCurve = Sequence.AddCurve( 0.15f, 0.1f ); Sequence.Play( this->AsShared() );

Constructor & Destructor Documentation

◆ FCurveSequence() [1/2]

FCurveSequence::FCurveSequence ( )

Default constructor

◆ ~FCurveSequence()

FCurveSequence::~FCurveSequence ( )

Makes sure the active timer is unregistered

◆ FCurveSequence() [2/2]

FCurveSequence::FCurveSequence ( const float  InStartTimeSeconds,
const float  InDurationSeconds,
const ECurveEaseFunction  InEaseFunction = ECurveEaseFunction::Linear 
)

Construct by adding a single animation curve to this sequence. Does not provide access to the curve though.

Parameters
InStartTimeSecondsWhen to start this curve.
InDurationSecondsHow long this curve lasts.
InEaseFunctionEasing function to use for this curve. Defaults to Linear. Use this to smooth out your animation transitions.
Returns
A FCurveHandle that can be used to get the value of this curve after the animation starts playing.

Member Function Documentation

◆ AddCurve()

FCurveHandle FCurveSequence::AddCurve ( const float  InStartTimeSeconds,
const float  InDurationSeconds,
const ECurveEaseFunction  InEaseFunction = ECurveEaseFunction::Linear 
)

Add a new curve at a given time and offset.

Parameters
InStartTimeSecondsWhen to start this curve.
InDurationSecondsHow long this curve lasts.
InEaseFunctionEasing function to use for this curve. Defaults to Linear. Use this to smooth out your animation transitions.
Returns
A FCurveHandle that can be used to get the value of this curve after the animation starts playing.

◆ AddCurveRelative()

FCurveHandle FCurveSequence::AddCurveRelative ( const float  InOffset,
const float  InDurationSecond,
const ECurveEaseFunction  InEaseFunction = ECurveEaseFunction::Linear 
)

Add a new curve relative to the current end of the sequence. Makes stacking easier. e.g. doing AddCurveRelative(0,5); AddCurveRelative(0,3); Is equivalent to AddCurve(0,5); AddCurve(5,3)

Parameters
InOffsetOffset from the last curve in the sequence.
InDurationSecondHow long this curve lasts.
InEaseFunctionEasing function to use for this curve. Defaults to Linear. Use this to smooth out your animation transitions.

◆ GetCurve()

const FCurveSequence::FSlateCurve & FCurveSequence::GetCurve ( int32  CurveIndex) const
Parameters
CurveIndexIndex of a curve in the curves array.
Returns
A curve given the index into the curves array

◆ GetLerp()

float FCurveSequence::GetLerp ( ) const

For single-curve animations, returns the interpolation alpha for the animation. If you call this function on a sequence with multiple curves, an assertion will trigger.

Returns
A linearly interpolated value between 0 and 1 for this curve.

◆ GetSequenceTime()

float FCurveSequence::GetSequenceTime ( ) const
Returns
the current time relative to the beginning of the sequence.

◆ IsAtEnd()

bool FCurveSequence::IsAtEnd ( ) const

Is the sequence at the end?

◆ IsAtStart()

bool FCurveSequence::IsAtStart ( ) const

Is the sequence at the start?

◆ IsForward()

bool FCurveSequence::IsForward ( ) const
Returns
true if the animation is in forward gear

◆ IsInReverse()

bool FCurveSequence::IsInReverse ( ) const
Returns
true if the animation is in reverse

◆ IsLooping()

bool FCurveSequence::IsLooping ( ) const

Is the sequence looping?

◆ IsPlaying()

bool FCurveSequence::IsPlaying ( ) const

Checks whether the sequence is currently playing.

Returns
true if playing, false otherwise.

◆ JumpToEnd()

void FCurveSequence::JumpToEnd ( )

Jumps immediately to the end of the animation sequence

◆ JumpToStart()

void FCurveSequence::JumpToStart ( )

Jumps immediately to the beginning of the animation sequence

◆ Pause()

void FCurveSequence::Pause ( )

Pause this curve sequence.

◆ Play() [1/2]

void FCurveSequence::Play ( const FTickerDelegate InDelegate,
bool  bPlayLooped = false,
const float  StartAtTime = 0.0f 
)

Plays the curve sequence for a ticker, rather than a widget.

◆ Play() [2/2]

void FCurveSequence::Play ( const TSharedRef< SWidget > &  InOwnerWidget,
bool  bPlayLooped = false,
const float  StartAtTime = 0.0f,
bool  bRequiresActiveTimer = true 
)

Start playing this curve sequence. Registers an active timer with the widget being animated.

Parameters
InOwnerWidgetThe widget that is being animated by this sequence.
bPlayLoopedTrue if the curve sequence should play continually on a loop. Note that the active timer will persist until this sequence is paused or jumped to the start/end.
StartAtTimeThe relative time within the animation at which to begin playing (i.e. 0.0f is the beginning).
bRequiresActiveTimerWhether or not we need to register an active timer on the widget to keep slate ticking while the animation is playing. If that is not necessary in your use case, you can set it to false for a small performance boost

◆ PlayRelative()

void FCurveSequence::PlayRelative ( const TSharedRef< SWidget > &  InOwnerWidget,
bool  bForward 
)

Plays forward if it can, otherwise holds it at the end of the animation, if we play in reverse it will reverse the animation if it can

◆ PlayReverse()

void FCurveSequence::PlayReverse ( const TSharedRef< SWidget > &  InOwnerWidget,
bool  bPlayLooped = false,
const float  StartAtTime = 0.0f,
bool  bRequiresActiveTimer = true 
)

Start playing this curve sequence in reverse. Registers an active timer for the widget using the sequence.

Parameters
InOwnerWidgetThe widget that is being animated by this sequence.
bPlayLoopedTrue if the curve sequence should play continually on a loop. Note that the active timer will persist until this sequence is paused or jumped to the start/end.
StartAtTimeThe relative time within the animation at which to begin playing (i.e. 0.0f is the beginning).
bRequiresActiveTimerWhether or not we need to register an active timer on the widget to keep slate ticking while the animation is playing. If that is not necessary in your use case, you can set it to false for a small performance boost

◆ Resume()

void FCurveSequence::Resume ( )

Unpause this curve sequence to resume play.

◆ Reverse()

void FCurveSequence::Reverse ( )

Reverse the direction of an in-progress animation

◆ SetStartTime()

void FCurveSequence::SetStartTime ( double  InStartTime)
protected
Parameters
InStartTimewhen this curve sequence started playing

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