3 #ifndef __GAF_ANIMATED_OBJECT_H__
4 #define __GAF_ANIMATED_OBJECT_H__
6 #include "GAFAnimation.h"
7 #include "GAFCollections.h"
9 #include "GAFDelegates.h"
17 enum PCAnimationFPSType
19 kGAFAnimationFPSType_15 = 15,
20 kGAFAnimationFPSType_30 = 30,
21 kGAFAnimationFPSType_60 = 60
24 enum GAFAnimatedObjectControlFlags
26 kGAFAnimatedObjectControl_None = 0,
29 kGAFAnimatedObjectControl_ApplyState = 1 << 0
40 SubObjects_t m_subObjects;
45 CaptureObjects_t m_capturedObjects;
46 bool _animationsSelectorScheduled;
50 cocos2d::SpriteBatchNode* m_batch;
52 int numberOfGlobalFramesForOneAnimationFrame();
53 int _extraFramesCounter;
54 PCAnimationFPSType _FPSType;
57 void _updateStencilLayer(
int newLayer);
61 static GAFAnimatedObject * createAndRun(
const std::string& gafPath,
bool looped =
false);
64 void processAnimations(
float dt);
65 cocos2d::Vect pupilCoordinatesWithXSemiaxis(
float anXSemiaxis,
float anYSemiaxis, cocos2d::Vect aCenter, cocos2d::Vect anExternalPoint);
66 void removeAllSubObjects();
68 void instantiateObject(
const AnimationObjects_t& objs,
const AnimationMasks_t& masks);
70 void setSubobjectsVisible(
bool visible);
72 const SubObjects_t& getSubojects()
const;
73 const SubObjects_t& getMasks()
const;
75 void animatorDidPlayedFrame(GAFAnimator * anAnimator,
int aFrameNo);
79 virtual void processAnimation();
92 cocos2d::Rect realBoundingBoxForCurrentFrame();
99 cocos2d::Sprite* renderCurrentFrameToTexture(
bool usePOTTextures =
false);
101 void realizeFrame(cocos2d::Node* out,
int frameIndex);
120 #endif // __GAF_ANIMATED_OBJECT_H__
Definition: GAFAnimatedObject.h:33
Definition: GAFSprite.h:23
Definition: GAFAsset.h:18
Definition: GAFDelegates.h:43
void decStencilLayer()
0 means all masked pixels will be marked as 1 and so on
Definition: GAFAnimatedObject.cpp:716
void setStencilLayer(int newLayer)
0 means all masked pixels will be marked as 1 and so on
Definition: GAFAnimatedObject.cpp:704
unsigned int objectIdByObjectName(const std::string &aName)
Returns object id by it name, defined in NamedParts.
Definition: GAFAnimatedObject.cpp:116
Definition: GAFDelegates.h:33
void enableBatching(bool value)
Experimental feature, will work only for single textured objects without masks. Still glitches...
Definition: GAFAnimatedObject.cpp:727
bool captureControlOverSubobjectNamed(const char *aName, GAFAnimatedObjectControlFlags aControlFlags)
Definition: GAFAnimatedObject.cpp:240
GAFSprite * subObjectForInnerObjectId(unsigned int anInnerObjectId)
Returns subobject by it id.
Definition: GAFAnimatedObject.cpp:351
void releaseControlOverSubobjectNamed(const char *aName)
Releases control over subobject captured earlier.
Definition: GAFAnimatedObject.cpp:259
void incStencilLayer()
0 means all masked pixels will be marked as 1 and so on
Definition: GAFAnimatedObject.cpp:710
int getStencilLayer() const
0 means all masked pixels will be marked as 1 and so on
Definition: GAFAnimatedObject.cpp:722
Definition: GAFAnimation.h:19