This animation translates a CGUIObject from a start position to a target position. More...
#include <GUIAnimationMove.h>
Public Member Functions | |
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) | |
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) |
![]() | |
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 () |
CGUIObject * | GetAnimatedObject () 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) |
![]() | |
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 () |
![]() | |
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 | MOVE_ANIMATION_CLASS_MIN_VERSION |
The minimal class version allowed. | |
static const eC_UInt | MOVE_ANIMATION_CLASS_VERSION |
The class version of the implementation. | |
![]() | |
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 const eC_Char | XMLTAG_CLASSVERSION [] |
Additional Inherited Members | |
![]() | |
enum | AnimationStatus_t { ANIMATION_RUNNING , ANIMATION_PAUSED , ANIMATION_STOPPED , ANIMATION_FINISHED , ANIMATION_DELETED } |
![]() | |
static UUID_t | GenerateUUID () |
![]() | |
CGUIAnimation () | |
CGUIAnimation (CGUIObject *pkAnimatedObject, eC_UInt uiDuration, eC_UInt uiStepTime=25, eC_Bool bDeletedAfterFinish=false) | |
void | AddAnimatedAttribute (CGUIAnimatedAttribute kAnimatedAttribute) |
CGUIAnimatedAttribute & | GetAnimatedAttribute (const eC_UInt &uiAttributeIndex) const |
virtual void | OnStatusChanged (AnimationStatus_t eStatus) |
void | RemoveAnimatedAttributes () |
![]() | |
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 |
![]() | |
eC_TListDoubleLinked< CGUIAnimatedAttribute > * | m_pkAnimatedAttributes |
available animated attributes | |
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:
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
pAnimatedObject | The Object that shall be moved. |
eEasingX | The easing type that is used for the XPos of the object. |
eEasingY | The easing type that is used for the YPos of the object. |
vStartX | X-position at start of animation. |
vStartY | Y-position at start of animation. |
vTargetX | Target X-position of animation. |
vTargetY | Target Y-position of animation. |
uiDuration | The duration for the complete animation in ms. |
bUseCurrentPosition | If set to true the start position of the animation will be set to the current position of the animated object. |
uiStepTime | The time between two animation steps in ms. |
CGUIAnimationMove::CGUIAnimationMove | ( | ) |
Default constructor for streaming.
|
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()
uiElapsedTime | Time elapsed (in ms) since start of animation. |
Implements CGUIAnimation.
|
virtual |
Sets the animated object to the start position.
Reimplemented from CGUIAnimation.
|
virtual |
Reads attributes from the streaming file. Only for use with GUIFactoryManager.
Reimplemented from CGUIAnimation.
void CGUIAnimationMove::SetStartPos | ( | const eC_Value | vStartX, |
const eC_Value | vStartY | ||
) |
Set the start position of the move animation.
vStartX | X coordinate of the starting point of the animation. |
vStartY | Y coordinate of the starting point of the animation. |
void CGUIAnimationMove::SetTargetPos | ( | const eC_Value | vTargetX, |
const eC_Value | vTargetY | ||
) |
Set the target position of the move animation.
vTargetX | X coordinate of the target point of the animation. |
vTargetY | Y coordinate of the target point of the animation. |
|
virtual |
Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.
bWriteClassID | This 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.