Guiliani  Version 2.5 revision 7293 (documentation build 13)
CGUIEasing Class Reference

A CGUIEasing can be used for Guiliani animations. More...

#include <GUIEasing.h>

Public Types

enum  EasingType_t {
  EASE_NONE , EASE_LINEAR , EASE_IN_SINE , EASE_OUT_SINE ,
  EASE_IN_OUT_SINE , EASE_OUT_IN_SINE , EASE_IN_QUAD , EASE_OUT_QUAD ,
  EASE_IN_OUT_QUAD , EASE_OUT_IN_QUAD , EASE_IN_CUBIC , EASE_OUT_CUBIC ,
  EASE_IN_OUT_CUBIC , EASE_OUT_IN_CUBIC , EASE_IN_QUART , EASE_OUT_QUART ,
  EASE_IN_OUT_QUART , EASE_OUT_IN_QUART , EASE_IN_EXPO , EASE_OUT_EXPO ,
  EASE_IN_OUT_EXPO , EASE_OUT_IN_EXPO , EASE_IN_QUINT , EASE_OUT_QUINT ,
  EASE_IN_OUT_QUINT , EASE_OUT_IN_QUINT , EASE_IN_CIRC , EASE_OUT_CIRC ,
  EASE_IN_OUT_CIRC , EASE_OUT_IN_CIRC , EASE_IN_ELASTIC , EASE_OUT_ELASTIC ,
  EASE_IN_OUT_ELASTIC , EASE_OUT_IN_ELASTIC , EASE_IN_BACK , EASE_OUT_BACK ,
  EASE_IN_OUT_BACK , EASE_OUT_IN_BACK , EASE_IN_BOUNCE , EASE_OUT_BOUNCE ,
  EASE_IN_OUT_BOUNCE , EASE_OUT_IN_BOUNCE , EASE_NUM_OF
}
 The differnet easing types.
 

Public Member Functions

 CGUIEasing ()
 Constructor.
 
virtual ~CGUIEasing ()
 Destructor.
 
virtual eC_Value Ease (EasingType_t eEasingType, eC_Value vTime, eC_Value vBegin, eC_Value vChange, eC_Value vDuration)
 
virtual eC_Value operator() (EasingType_t eEasingType, eC_Value vTime, eC_Value vBegin, eC_Value vChange, eC_Value vDuration)
 

Detailed Description

A CGUIEasing can be used for Guiliani animations.

It provides access to the most commonly used easing algorithms. They calculate the current value dependent on its time based on 3 parameters (begin value, change value and duration) and of course the easing equation.

void CGUIAnimationMove::ApplyAnimation(eC_UInt uiElapsedTime)
{
CGUIEasing kEasing;
CGUIObject* pAnimatedObj = GetAnimatedObject();
if (pAnimatedObj != NULL)
{
pAnimatedObj->InvalidateArea();
if (m_eEasingX != CGUIEasing::EASE_NONE)
pAnimatedObj->SetRelXPos(kEasing(m_eEasingX, eC_FromInt(uiElapsedTime), m_vStartX, m_vTargetX - m_vStartX, eC_FromInt(GetDuration())));
if (m_eEasingY != CGUIEasing::EASE_NONE)
pAnimatedObj->SetRelYPos(kEasing(m_eEasingY, eC_FromInt(uiElapsedTime), m_vStartY, m_vTargetY - m_vStartY, eC_FromInt(GetDuration())));
pAnimatedObj->InvalidateArea();
}
}
void ApplyAnimation(eC_UInt uiElapsedTime)
A CGUIEasing can be used for Guiliani animations.
Definition: GUIEasing.h:46
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:79
virtual void SetRelYPos(const eC_Value &vY)
void InvalidateArea()
virtual void SetRelXPos(const eC_Value &vX)

Member Function Documentation

◆ Ease()

virtual eC_Value CGUIEasing::Ease ( EasingType_t  eEasingType,
eC_Value  vTime,
eC_Value  vBegin,
eC_Value  vChange,
eC_Value  vDuration 
)
virtual

This function is called by the animation to calculate the new value of an attribute depending on time (vTime) and chosen easing function.

Parameters
eEasingTypeID of chosen easing type.
vTimeTime elapsed (in ms) since start of animation.
vBeginStart value of the animated attribute.
vChangeAt the end of the animation (duration reached) the animated attribute gain vBegin + vChange.
vDurationDuration of animation (in ms). This defines the valid time interval (0/duration) used for the easing interpolation.
Returns
The result of the chosen easing type (interpolation).

◆ operator()()

virtual eC_Value CGUIEasing::operator() ( EasingType_t  eEasingType,
eC_Value  vTime,
eC_Value  vBegin,
eC_Value  vChange,
eC_Value  vDuration 
)
virtual

This function object is called by the animation to calculate the new value of an attribute depending on time (vTime) and chosen easing function.

Parameters
eEasingTypeID of chosen easing type.
vTimeTime elapsed (in ms) since start of animation.
vBeginStart value of the animated attribute.
vChangeAt the end of the animation (duration reached) the animated attribute gain vBegin + vChange.
vDurationDuration of animation (in ms). This defines the valid time interval (0/duration) used for the easing interpolation.
Returns
The result of the chosen easing function (interpolation) .

The documentation for this class was generated from the following file: