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

This animation translates a CGUIObject from a start position to a target position. More...

#include <GUIAnimationMove.h>

Inheritance diagram for CGUIAnimationMove:

Public Member Functions

 CGUIAnimationMove (CGUIObject *pAnimatedObject, CGUIEasing::EasingType_t eEasingX, CGUIEasing::EasingType_t eEasingY, eC_Value vStartX, eC_Value vStartY, eC_Value vTargetX, eC_Value vTargetY, eC_UInt uiDuration, eC_Bool bUseCurrentPosition=false, eC_UInt uiStepTime=25)
 
 CGUIAnimationMove ()
 
void ApplyAnimation (eC_UInt uiElapsedTime)
 
void InitAttributes ()
 
void ReadFromStream ()
 
void SetStartPos (const eC_Value vStartX, const eC_Value vStartY)
 
void SetTargetPos (const eC_Value vTargetX, const eC_Value vTargetY)
 
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

static const eC_UInt MOVE_ANIMATION_CLASS_MIN_VERSION = 2
 The minimal class version allowed.
 
static const eC_UInt MOVE_ANIMATION_CLASS_VERSION = 3
 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"
 

Additional Inherited Members

- Public Types inherited from CGUIAnimation
enum  AnimationStatus_t {
  ANIMATION_RUNNING, ANIMATION_PAUSED, ANIMATION_STOPPED, ANIMATION_FINISHED,
  ANIMATION_DELETED
}
 
- 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
 
virtual void OnStatusChanged (AnimationStatus_t eStatus)
 
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
 
- Protected Attributes inherited from CGUIAnimation
eC_TListDoubleLinked< CGUIAnimatedAttribute > * m_pkAnimatedAttributes
 available animated attributes
 

Detailed Description

This animation translates a CGUIObject from a start position to a target position.

The duration for the animation determines the animation's speed.

The animation is achieved by interpolating between the start position and the target position. For the interpolation CGUIEasing functions are used. The CGUIEasing functions are passed in the constructor.

Example:

// The animation shall be done in 5 seconds.
const eC_Value vStartX = eC_FromInt(100);
const eC_Value vStartY = eC_FromInt(100);
const eC_Value vTargetX = eC_FromInt(200);
const eC_Value vTargetY = eC_FromInt(200);
const eC_UInt uiDuration = 5000;
// Now create the instance of the animation.
pkAnimatedObject, CGUIEasing::EASE_LINEAR, CGUIEasing::EASE_LINEAR,
vStartX, vStartY, vTargetX, vTargetY, uiDuration);
// To start the animation call the StartAnimation() method of the animation.
pAnimation->StartAnimation();
//If the instance of the animation is not available directly use the AnimationHandler.
eC_UInt uiMyAnimationID = pAnimation->GetID();
GETANIMATIONHDL.GetAnimation(uiMyAnimationID);

Constructor & Destructor Documentation

◆ CGUIAnimationMove() [1/2]

CGUIAnimationMove::CGUIAnimationMove ( CGUIObject pAnimatedObject,
CGUIEasing::EasingType_t  eEasingX,
CGUIEasing::EasingType_t  eEasingY,
eC_Value  vStartX,
eC_Value  vStartY,
eC_Value  vTargetX,
eC_Value  vTargetY,
eC_UInt  uiDuration,
eC_Bool  bUseCurrentPosition = false,
eC_UInt  uiStepTime = 25 
)

Constructor

Parameters
pAnimatedObjectThe Object that shall 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.
vStartXX-position at start of animation.
vStartYY-position at start of animation.
vTargetXTarget X-position of animation.
vTargetYTarget Y-position of animation.
uiDurationThe duration for the complete animation in ms.
bUseCurrentPositionIf set to true the start position of the animation will be set to the current position of the animated object.
uiStepTimeThe time between two animation steps in ms.

◆ CGUIAnimationMove() [2/2]

CGUIAnimationMove::CGUIAnimationMove ( )

Default constructor for streaming.

Member Function Documentation

◆ ApplyAnimation()

void CGUIAnimationMove::ApplyAnimation ( eC_UInt  uiElapsedTime)
virtual

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()

Parameters
uiElapsedTimeTime elapsed (in ms) since start of animation.

Implements CGUIAnimation.

◆ InitAttributes()

void CGUIAnimationMove::InitAttributes ( )
virtual

Sets the animated object to the start position.

Reimplemented from CGUIAnimation.

◆ ReadFromStream()

void CGUIAnimationMove::ReadFromStream ( )
virtual

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

See also
CGUIObject::ReadFromStream()

Reimplemented from CGUIAnimation.

◆ SetStartPos()

void CGUIAnimationMove::SetStartPos ( const eC_Value  vStartX,
const eC_Value  vStartY 
)

Set the start position of the move animation.

Parameters
vStartXX coordinate of the starting point of the animation.
vStartYY coordinate of the starting point of the animation.

◆ SetTargetPos()

void CGUIAnimationMove::SetTargetPos ( const eC_Value  vTargetX,
const eC_Value  vTargetY 
)

Set the target position of the move animation.

Parameters
vTargetXX coordinate of the target point of the animation.
vTargetYY coordinate of the target point of the animation.

◆ WriteToStream()

void CGUIAnimationMove::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

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

Parameters
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: