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

This animation resizes a CGUIObject from a start dimension to a target dimension. More...

#include <GUIAnimationSize.h>

Inheritance diagram for CGUIAnimationSize:

Public Member Functions

 CGUIAnimationSize ()
 
 CGUIAnimationSize (CGUIObject *pAnimatedObject, CGUIEasing::EasingType_t eEasingWidth, CGUIEasing::EasingType_t eEasingHeight, eC_Value vStartWidth, eC_Value vStartHeight, eC_Value vTargetWidth, eC_Value vTargetHeight, eC_Bool bKeepCenterPosition, eC_UInt uiDuration, eC_UInt uiStepTime=25)
 
void ApplyAnimation (eC_UInt uiElapsedTime)
 
void ReadFromStream ()
 
void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIAnimation
virtual ~CGUIAnimation ()
 
void AddAnimationObserver (CGUIAnimationObserver *pkObserver)
 
virtual void ApplyAnimation (eC_UInt uiElapsedTime)=0
 
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
 
virtual void InitAttributes ()
 
eC_Bool IsDeletedAfterFinish () const
 
eC_Bool IsPaused () const
 
void PauseAnimation ()
 
void ReadFromStream ()
 
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 ()
 
void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
virtual void ReadFromStream ()
 
void SetXMLTag (const eC_String &kXMLTag)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 

Static Public Attributes

static const eC_UInt SIZE_ANIMATION_CLASS_MIN_VERSION
 The minimal class version allowed.
 
static const eC_UInt SIZE_ANIMATION_CLASS_VERSION
 
- Static Public Attributes inherited from CGUIAnimation
static const eC_Char XMLTAG_ANIMATIONCLASSID []
 XML tag to be used when writing a animation class ID into a stream.
 
static const eC_Char XMLTAG_ANIMATIONENDTAG []
 XML tag to be used when finish writing CGUIAnimation information into the stream.
 
static const eC_Char XMLTAG_ANIMATIONID []
 XML tag to be used when writing a animation ID into a stream.
 
static const eC_Char XMLTAG_ANIMATIONSTARTTAG []
 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 []
 

Protected Attributes

eC_Bool m_bKeepCenterPosition
 Indicates if the object's center-point shall remain unchanged during animation.
 
- Protected Attributes inherited from CGUIAnimation
eC_TListDoubleLinked< CGUIAnimatedAttribute > * m_pkAnimatedAttributes
 available animated attributes
 

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
 

Detailed Description

This animation resizes a CGUIObject from a start dimension to a target dimension.

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

Example:

// This example resizes the object to half width and half height.
// The animation shall be done in 5 seconds.
const eC_UInt uiDuration = 5000;
const eC_Value vStartWidth = pkAnimatedObject->GetWidth();
const eC_Value vStartHeight = pkAnimatedObject->GetHeight();
const eC_Value vTargetWidth = pkAnimatedObject->GetHalfWidth();
const eC_Value vTargetHeight = pkAnimatedObject->GetHalfHeight();
// Now create the instance of the animation.
CGUIAnimationSize* pAnimation = new CGUIAnimationSize(pkAnimatedObject, CGUIEasing::EASE_LINEAR, CGUIEasing::EASE_LINEAR,
vStartWidth, vStartHeight, vTargetWidth, vTargetHeight, 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.
GETANIMATIONHDL.GetAnimation(uiMyAnimationID);
void StartAnimation()
This animation resizes a CGUIObject from a start dimension to a target dimension.
Definition: GUIAnimationSize.h:49

Constructor & Destructor Documentation

◆ CGUIAnimationSize() [1/2]

CGUIAnimationSize::CGUIAnimationSize ( CGUIObject pAnimatedObject,
CGUIEasing::EasingType_t  eEasingWidth,
CGUIEasing::EasingType_t  eEasingHeight,
eC_Value  vStartWidth,
eC_Value  vStartHeight,
eC_Value  vTargetWidth,
eC_Value  vTargetHeight,
eC_Bool  bKeepCenterPosition,
eC_UInt  uiDuration,
eC_UInt  uiStepTime = 25 
)

Constructor

Parameters
pAnimatedObjectThe Object that shall be resized.
eEasingWidthThe easing type that is used for the width of the object.
eEasingHeightThe easing type that is used for the height of the object.
vStartWidthWidth at start of animation.
vStartHeightHeight at start of animation.
vTargetWidthTarget width of animated object.
vTargetHeightTarget height of animated object.
bKeepCenterPositionIf TRUE then the object's center position remains unchanged while resizing. if FALSE then the position of the object's top/left corner remains unchanged.
uiDurationThe duration for the complete animation in ms.
uiStepTimeThe time between two animation steps in ms.

◆ CGUIAnimationSize() [2/2]

CGUIAnimationSize::CGUIAnimationSize ( )

Default constructor for streaming.

Member Function Documentation

◆ ApplyAnimation()

void CGUIAnimationSize::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. Sets the width and height of the animated object using the CGUIEasing functions' current values. This function is called by DoAnimate()

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

Implements CGUIAnimation.

◆ ReadFromStream()

void CGUIAnimationSize::ReadFromStream ( )
virtual

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

See also
CGUIObject::ReadFromStream()

Reimplemented from CGUIAnimation.

◆ WriteToStream()

void CGUIAnimationSize::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.

Member Data Documentation

◆ SIZE_ANIMATION_CLASS_VERSION

const eC_UInt CGUIAnimationSize::SIZE_ANIMATION_CLASS_VERSION
static

The class version of the size animation class


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