Guiliani  Version 2.4 revision 5970 (build 3)
CGUIAnimationMoveInOut Class Reference

Animation moving an object into or out of the visible area. More...

#include <GUIAnimationMoveInOut.h>

Inheritance diagram for CGUIAnimationMoveInOut:

Public Types

- Public Types inherited from CGUIAnimation
enum  AnimationStatus_t {

Public Member Functions

 CGUIAnimationMoveInOut ()
 CGUIAnimationMoveInOut (CGUIObject *pAnimatedObject, CGUIEasing::EasingType_t eEasingX, CGUIEasing::EasingType_t eEasingY, MoveDirection_t eDirection, eC_Bool bMoveOutOnStart=false, eC_UInt uiDuration=1000, eC_UInt uiStepTime=25)
void ApplyAnimation (eC_UInt uiElapsedTime)
eC_Value GetOriginalXPos ()
eC_Value GetOriginalYPos ()
eC_Bool IsMovingOut ()
void ReadFromStream ()
void WriteToStream (const eC_Bool bWriteClassID=false)
- Public Member Functions inherited from CGUIAnimation
virtual ~CGUIAnimation ()
void AddAnimationObserver (CGUIAnimationObserver *pkObserver)
void ContinueAnimation ()
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
eC_TListDoubleLinked< CGUIAnimatedAttribute > * GetAnimatedAttributes ()
CGUIObjectGetAnimatedObject () const
ObjectHandle_t GetAnimatedObjectID () const
eC_UInt GetDuration () const
eC_UInt GetID () const
eC_UInt GetStepTime () const
eC_Bool IsDeletedAfterFinish () const
eC_Bool IsPaused () const
void PauseAnimation ()
void RemoveAnimationObserver (CGUIAnimationObserver *pkObserver)
void SetAnimatedObject (CGUIObject *pkObject)
void SetAnimatedObjectID (const ObjectHandle_t &eObject)
void SetAnimationObserver (CGUIAnimationObserver *pkObserver)
void SetDeletedAfterFinish (const eC_Bool bDeletedAfterFinish)
void SetDuration (eC_UInt uiDuration)
void StartAnimation ()
void StopAnimation ()
void UpdateAnimatedObjectPointer ()
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
virtual eC_Bool IsAnimating () const
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
void SetXMLTag (const eC_String &kXMLTag)

Static Public Attributes

 The minimal class version allowed.
 The class version of the implementation.
- Static Public Attributes inherited from CGUIAnimation
static const eC_Char XMLTAG_ANIMATIONCLASSID [] = "AnimationClassID"
 XML tag to be used when writing a animation class ID into a stream.
static const eC_Char XMLTAG_ANIMATIONENDTAG [] = "/GUIAnimation"
 XML tag to be used when finish writing CGUIAnimation information into the stream.
static const eC_Char XMLTAG_ANIMATIONID [] = "AnimationID"
 XML tag to be used when writing a animation ID into a stream.
static const eC_Char XMLTAG_ANIMATIONSTARTTAG [] = "GUIAnimation"
 XML tag to be used when start writing CGUIAnimation information into the stream.
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"

Protected Member Functions

void InitAttributes ()
void OnStatusChanged (AnimationStatus_t eStatus)
- Protected Member Functions inherited from CGUIAnimation
 CGUIAnimation ()
 CGUIAnimation (CGUIObject *pkAnimatedObject, eC_UInt uiDuration, eC_UInt uiStepTime=25, eC_Bool bDeletedAfterFinish=false)
void AddAnimatedAttribute (CGUIAnimatedAttribute kAnimatedAttribute)
CGUIAnimatedAttributeGetAnimatedAttribute (const eC_UInt &uiAttributeIndex) const
void RemoveAnimatedAttributes ()
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const

Additional Inherited Members

- Protected Attributes inherited from CGUIAnimation
eC_TListDoubleLinked< CGUIAnimatedAttribute > * m_pkAnimatedAttributes
 available animated attributes

Detailed Description

Animation moving an object into or out of the visible area.

This animation moves an object into or out of the visible area of its parent using its current position as start or end position. The Direction determines where the object is moved to or from.

For the move direction TOP and BOTTOM the object is translated vertically, for LEFT and RIGHT it is translated horizontally.

The flag bMoveOutOnStart determines if the object is moved from the current position out of the visible area of its parent (true), or from outside of the parents visible area to the current position (false).

The object is set visible when the animation is constructed and therefore initialized.

This example moves an object into the middle of the screen assuming that the animated object is a direct child of the GUI.

pAnimatedObject->SetRelXPos(GETGUI.GetHalfWidth() - pAnimatedObject->GetHalfWidth());
pAnimatedObject->SetRelYPos(GETGUI.GetHalfHeight() - pAnimatedObject->GetHalfHeight());
CGUIAnimation* pAnimation = new CGUIAnimationMoveInOut(pAnimatedObject,
CGUIEasing::EASE_LINEAR, CGUIEasing::EASE_LINEAR, CGUIAnimationMoveInOut::MOVE_TOP, false, 2000);

Member Enumeration Documentation

◆ MoveDirection_t

Determies the move direction

Constructor & Destructor Documentation

◆ CGUIAnimationMoveInOut() [1/2]

CGUIAnimationMoveInOut::CGUIAnimationMoveInOut ( )

Default constructor for streaming.

◆ CGUIAnimationMoveInOut() [2/2]

CGUIAnimationMoveInOut::CGUIAnimationMoveInOut ( CGUIObject pAnimatedObject,
CGUIEasing::EasingType_t  eEasingX,
CGUIEasing::EasingType_t  eEasingY,
MoveDirection_t  eDirection,
eC_Bool  bMoveOutOnStart = false,
eC_UInt  uiDuration = 1000,
eC_UInt  uiStepTime = 25 


pAnimatedObjectThe GUIObject that will be moved.
eEasingXThe easing type that is used for the XPos of the object.
eEasingYThe easing type that is used for the YPos of the object.
eDirectionThe move direction.
bMoveOutOnStartTrue to move the object into the screen, false to move it out of the screen.
uiDurationThe total duraiton of the animation in milliseconds. Based on the distance the duration determines the animation speed.
uiStepTimeThe time between two animation steps in millisectionds.

Member Function Documentation

◆ ApplyAnimation()

void CGUIAnimationMoveInOut::ApplyAnimation ( eC_UInt  uiElapsedTime)

This function contains the animation logic. It typically accesses the animation's CGUIEasing functions to get the current values and sets these values in the animated object. This function is called by DoAnimate() Adapts the objects position after each animation step based on the current value of the CGUIEasing functions.

uiElapsedTimeTime elapsed (in ms) since start of animation.

Implements CGUIAnimation.

◆ GetOriginalXPos()

eC_Value CGUIAnimationMoveInOut::GetOriginalXPos ( )
The original XPosition of the object before the animation is started. This position is the start position (bMoveOutOnStart = false) / the destinaion position (bOutOnStart = true) for the animation.

◆ GetOriginalYPos()

eC_Value CGUIAnimationMoveInOut::GetOriginalYPos ( )
The original YPosition of the object before the animation is started. This position is the start position (bMoveOutOnStart = false) / the target position (bOutOnStart = true) for the animation.

◆ InitAttributes()

void CGUIAnimationMoveInOut::InitAttributes ( )

Initializes the object position and sets the object visible.

Reimplemented from CGUIAnimation.

◆ IsMovingOut()

eC_Bool CGUIAnimationMoveInOut::IsMovingOut ( )
the move operation. True if the object is moving out of its parent's area, False if it is moving into the parent's area.

◆ OnStatusChanged()

void CGUIAnimationMoveInOut::OnStatusChanged ( AnimationStatus_t  eStatus)

Makes the object invisible when it is moving out of the screen after the animation was finished. Also calls the base implementation to inform the animation observers.

eStatusThe new status of the animation.

Reimplemented from CGUIAnimation.

◆ ReadFromStream()

void CGUIAnimationMoveInOut::ReadFromStream ( )

Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also

Reimplemented from CGUIAnimation.

◆ WriteToStream()

void CGUIAnimationMoveInOut::WriteToStream ( const eC_Bool  bWriteClassID = false)

Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.

bWriteClassIDThis flag is used to switch writing of the class ID, leading and trailing tags. When implementing a new streamable object, check this flag. If it is true, first write the class ID, then continue with this object's attributes, and finally call the base class implementation with this flag set to false (this is the default).

Reimplemented from CGUIAnimation.

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