Skip to content

FaderInstance

class FaderInstance

A Fader instance. An object of this class will be created each time a Fader is requested.

Types

Name Description
Transition Create an animation transition function using * a one-dimensional cubic bezier curve.

Functions

Name Description
FaderInstance Constructs a new FaderInstance object.
~FaderInstance Default destructor.
Set Set up fader.
Set Set up fader.
SetDuration Sets the duration of the transition.
GetFromTime Gets the current fading value.
GetFromPercentage Gets the current fading value.
GetState Gets the state of this Fader.
SetState Sets the state of this Fader.
Start Sets the fading start time.

Function Details

FaderInstance

FaderInstance()

Constructs a new FaderInstance object.

This will initialize the fader instance state to default values.

GetFromPercentage

virtual AmReal64 GetFromPercentage(AmReal64 percentage)

Gets the current fading value.

Parameter percentage
The percentage of time elapsed. This should be in the range [0, 1].
Return
The current value.

GetFromTime

virtual AmReal64 GetFromTime(AmTime time)

Gets the current fading value.

To use this method you first need to define the fading start time using Start().

Parameter time
The time at which the value should be calculated.
Return
The current value.

GetState

[[nodiscard]] inline eFaderState GetState() const

Gets the state of this Fader.

Return
The Fader state.

Set

void Set(AmReal64 from, AmReal64 to, AmTime duration)

Set up fader.

Parameter from
The start value.
Parameter to
The target value.
Parameter duration
The duration of transition.

void Set(AmReal64 from, AmReal64 to)

Set up fader.

Parameter from
The start value.
Parameter to
The target value.

SetDuration

void SetDuration(AmTime duration)

Sets the duration of the transition.

Parameter duration
The transition duration.

SetState

inline void SetState(eFaderState state)

Sets the state of this Fader.

Parameter state
The state to set.

Start

void Start(AmTime time = 0.0)

Sets the fading start time.

Parameter time
The fading start time.

~FaderInstance

virtual ~FaderInstance() = default

Default destructor.