AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzActionsAnimation.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CZ_ACTIONS_ANIMATION_H_)
00015 #define _CZ_ACTIONS_ANIMATION_H_
00016 
00017 #include "CzActions.h"
00018 #include "CzXoml.h"
00019 
00020 /**
00021  @addtogroup Actions
00022  @{
00023  */
00024  
00025 /**
00026  @class CzXomlActions_Animation
00027 
00028  @brief Implements a collection of animation actions.
00029 
00030  The CzXomlActions_Animation class holds Actions (IzXomlAction) that can be carried out on Animation Timelines (CzAnimTimeline). An action is basically a command that tells 
00031  the animation to do something such as play or pause. For example the PauseTimeline tells the animation timeline to pause playback.
00032  
00033  The following actions are supported:
00034  - PlayTimeline     - Plays a timeline
00035  - StopTimeline     - Stops a timeline from playing
00036  - PauseTimeline    - Pauses the timeline playback
00037  - SetTimeline      - Assigns the timeline to an actor or scene
00038 
00039  The above actions have the following XOML prototypes:
00040  - PlayTimeline(timeline-name, actor-or-scene-name(optional))
00041    - timeline-name - Name of timeline
00042    - actor-or-scene-name - Scene or actor that contains the timeline
00043  - StopTimeline(timeline-name, actor-or-scene-name(optional))
00044    - timeline-name - Name of timeline
00045    - actor-or-scene-name - Scene or actor that contains the timeline
00046  - PauseTimeline(timeline-name, actor-or-scene-name(optional))
00047    - timeline-name - Name of timeline
00048    - actor-or-scene-name - Scene or actor that contains the timeline
00049  - SetTimeline(timeline-name, actor-or-scene-name(optional))
00050    - timeline-name - Name of timeline
00051    - actor-or-scene-name - Scene or actor that contains the timeline
00052 
00053  For more information on the animation system see CzAnim
00054  
00055  */
00056  
00057 class CzXomlActions_Animation : public IzXomlAction
00058 {
00059 public:
00060     enum eActionType
00061     {
00062         Action_PlayTimeline         = 0, 
00063         Action_StopTimeline         = 1, 
00064         Action_PauseTimeline        = 2, 
00065         Action_SetTimeline          = 3, 
00066         Action_Max                  = 4, 
00067     };
00068 protected:
00069     eActionType Type;
00070     CzXomlActions_Animation() {}
00071 public:
00072     CzXomlActions_Animation(eActionType type)
00073     {
00074         Type = type;
00075         switch (Type)
00076         {
00077         case Action_PlayTimeline:
00078             setActionName("playtimeline");
00079             break;
00080         case Action_StopTimeline:
00081             setActionName("stoptimeline");
00082             break;
00083         case Action_PauseTimeline:
00084             setActionName("pausetimeline");
00085             break;
00086         case Action_SetTimeline:
00087             setActionName("settimeline");
00088             break;
00089         }
00090     }
00091     void Execute(IzXomlResource* source, CzAction* action);
00092 };
00093 
00094 /// @}
00095 
00096 #endif // _CZ_ACTIONS_ANIMATION_H_