An AnimationChain is a combination of several independent animations. More...
#include <GUIAnimationChain.h>
Classes | |
struct | AnimationInfo_t |
Holds the animation id and the offset for each animation. More... | |
Public Types | |
enum | AnimationChain_t { PARALLEL_ANIMATION , CHAINED_ANIMATION } |
Defines the chain type. More... | |
typedef eC_TListDoubleLinked< AnimationInfo_t > | AnimationList_t |
The animation list is a double-linked list of animation info structs. | |
Public Member Functions | |
CGUIAnimationChain () | |
CGUIAnimationChain (const AnimationChain_t eType, const eC_Bool bCyclic=false) | |
virtual | ~CGUIAnimationChain () |
Destructor. | |
void | AddAnimation (CGUIAnimation *pkAnimation, eC_UInt uiTimeOffset=0) |
void | ContinueAnimation () |
virtual void | DoAnimate (const eC_Value &vTimes=eC_FromInt(1)) |
const CGUIAnimation * | GetAnimation (eC_UInt uiID) |
const AnimationList_t * | GetAnimations () |
AnimationChain_t | GetChainType () |
eC_Bool | GetCyclicAnimation () const |
eC_UInt | GetID () |
virtual eC_Bool | IsAnimating () const |
eC_Bool | IsPaused () const |
void | OnStatusChanged (CGUIAnimation::AnimationStatus_t eStatus, CGUIAnimation *pAnimation) |
void | PauseAnimation () |
void | ReadFromStream () |
void | RemoveAllAnimations () |
void | RemoveAnimation (CGUIAnimation *pkAnimation) |
void | SetCyclicAnimation (const eC_Bool bCyclicAnimation) |
void | StartAnimation () |
void | StopAnimation () |
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 () |
![]() | |
virtual | ~CGUIAnimationObserver () |
virtual void | OnStatusChanged (CGUIAnimation::AnimationStatus_t eStatus, CGUIAnimation *pAnimation)=0 |
![]() | |
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 | ANIMATION_CHAIN_CLASS_VERSION |
The class version of the animation chain class. | |
![]() | |
static const eC_Char | XMLTAG_CLASSVERSION [] |
Friends | |
class | CGUIAnimationHandler |
Additional Inherited Members | |
![]() | |
static UUID_t | GenerateUUID () |
![]() | |
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 |
An AnimationChain is a combination of several independent animations.
The animations can be started one after the other, or in parallel. For each animation which is added an optional time offset can be defined.
For an AnimationChain which allows parallel animations (AnimationChain_t::PARALLEL_ANIMATION), this offset is relative to the start time of the AnimationChain. For an AnimationChain which does not allow parallel execution(AnimationChain_t::CHAINED_ANIMATION), the time offset is relative to the end of the previous animation.
Each animation which is added to the animation chain will be added to the CGUIAnimationHandler.
Example:
CGUIAnimationChain::CGUIAnimationChain | ( | const AnimationChain_t | eType, |
const eC_Bool | bCyclic = false |
||
) |
Constructor
eType | The type of the animation chain. |
bCyclic | Defines if the chain starts at the beginning again, when the last animation is finished. |
CGUIAnimationChain::CGUIAnimationChain | ( | ) |
Default constructor used by the factory.
void CGUIAnimationChain::AddAnimation | ( | CGUIAnimation * | pkAnimation, |
eC_UInt | uiTimeOffset = 0 |
||
) |
Add an animation. The animation is owned and handled by the AnimationChain.
pkAnimation | The animation to add. |
uiTimeOffset | The offset relative to the previous animation in case of CHAINED_ANIMATION or relative to the animation start in case of PARALLEL_ANIMATION. |
void CGUIAnimationChain::ContinueAnimation | ( | ) |
Continue the execution of the animation chain. The timer callback will be restored (installed again).
|
virtual |
Timer callback for the animation chain which is used to handle the animation offsets.
vTimes | Ignored by base class, used by implemented animation to compensate for jitter |
Reimplemented from CGUIAnimatable.
const CGUIAnimation * CGUIAnimationChain::GetAnimation | ( | eC_UInt | uiID | ) |
uiID | The animation ID |
|
inline |
|
inline |
|
inline |
|
inline |
|
virtual |
Checks if the animation chain is currently animating.
Reimplemented from CGUIAnimatable.
eC_Bool CGUIAnimationChain::IsPaused | ( | ) | const |
Checks if the animation chain is currently paused.
|
virtual |
Called by the animations when they are finished or deleted. This is used for chained animations.
eStatus | The new status of the animation. |
pAnimation | The Animation whose status is updated. |
Implements CGUIAnimationObserver.
void CGUIAnimationChain::PauseAnimation | ( | ) |
Pause the execution of an animation chain. This includes pausing of the gaps (time offset) between animations. The timer callback will be removed.
|
virtual |
Reads attributes from the streaming file. Only for use with GUIFactoryManager.
Reimplemented from CGUIStreamableObject.
void CGUIAnimationChain::RemoveAllAnimations | ( | ) |
Remove all contained animations. This only clears the internal list. It does NOT delete any animation!
void CGUIAnimationChain::RemoveAnimation | ( | CGUIAnimation * | pkAnimation | ) |
Remove an animation. This only removes the animation from internal list. It does NOT delete the animation!
pkAnimation | The animation to remove. |
|
inline |
Activate or deactivate cyclic animation. The chain will restart at the beginning after the last animation finished, if cyclic animation is activated.
bCyclicAnimation | True to activate cyclic animation, false to deactivate. |
|
virtual |
Start the animation chain. All contained animations will be triggered based on their offsets and on the order in which they were added (only for CHAINED_ANIMATION).
Reimplemented from CGUIAnimatable.
|
virtual |
Stops all animations which are part of this chain.
Reimplemented from CGUIAnimatable.
|
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 CGUIStreamableObject.
|
friend |