GAF Library
Generic Animation Format
 All Classes Functions Pages
Public Member Functions | Static Public Member Functions | List of all members
GAFAnimatedObject Class Reference
Inheritance diagram for GAFAnimatedObject:
GAFAnimation

Public Member Functions

bool init (GAFAsset *anAsset)
 
void processAnimations (float dt)
 
cocos2d::Vect pupilCoordinatesWithXSemiaxis (float anXSemiaxis, float anYSemiaxis, cocos2d::Vect aCenter, cocos2d::Vect anExternalPoint)
 
void removeAllSubObjects ()
 
void instantiateObject (const AnimationObjects_t &objs, const AnimationMasks_t &masks)
 
void setSubobjectsVisible (bool visible)
 
const SubObjects_t & getSubojects () const
 
const SubObjects_t & getMasks () const
 
void animatorDidPlayedFrame (GAFAnimator *anAnimator, int aFrameNo)
 
virtual void start ()
 
virtual void stop ()
 
virtual void processAnimation ()
 
bool captureControlOverSubobjectNamed (const char *aName, GAFAnimatedObjectControlFlags aControlFlags)
 
void releaseControlOverSubobjectNamed (const char *aName)
 Releases control over subobject captured earlier.
 
void setFramePlayedDelegate (GAFFramePlayedDelegate *delegate)
 
void setControlDelegate (GAFAnimatedObjectControlDelegate *delegate)
 
cocos2d::Rect realBoundingBoxForCurrentFrame ()
 
GAFSpritesubObjectForInnerObjectId (unsigned int anInnerObjectId)
 Returns subobject by it id.
 
unsigned int objectIdByObjectName (const std::string &aName)
 Returns object id by it name, defined in NamedParts.
 
cocos2d::Sprite * renderCurrentFrameToTexture (bool usePOTTextures=false)
 
void realizeFrame (cocos2d::Node *out, int frameIndex)
 
void setStencilLayer (int newLayer)
 0 means all masked pixels will be marked as 1 and so on
 
void incStencilLayer ()
 0 means all masked pixels will be marked as 1 and so on
 
void decStencilLayer ()
 0 means all masked pixels will be marked as 1 and so on
 
int getStencilLayer () const
 0 means all masked pixels will be marked as 1 and so on
 
void enableBatching (bool value)
 Experimental feature, will work only for single textured objects without masks. Still glitches, required to be enabled manually.
 
- Public Member Functions inherited from GAFAnimation
bool init (GAFAsset *anAnimationData)
 
virtual void pauseAnimation ()
 
virtual void resumeAnimation ()
 
virtual void step ()
 
bool isDone () const
 
bool isAnimationRunning () const
 
bool isLooped () const
 
void setLooped (bool looped)
 
bool isReversed () const
 
void setReversed (bool reversed)
 
int totalFrameCount () const
 
int currentFrameIndex () const
 
bool setFrame (int index)
 
bool gotoAndStop (const char *frameLabel)
 Plays specified frame and then stops.
 
bool gotoAndStop (int frameNumber)
 
bool gotoAndPlay (const char *frameLabel)
 Plays animation from specified frame.
 
bool gotoAndPlay (int frameNumber)
 
int getStartFrame (const char *frameLabel)
 
int getEndFrame (const char *frameLabel)
 
bool playSequence (const char *name, bool looped=false, bool resume=true, AnimSetSequenceHint hint=ASSH_RESTART)
 
void clearSequence ()
 
void setSequenceDelegate (GAFSequenceDelegate *delegate)
 
void setAnimationPlaybackDelegate (GAFAnimationPlaybackDelegate *delegate)
 
bool hasSequences () const
 

Static Public Member Functions

static GAFAnimatedObjectcreate (GAFAsset *anAsset)
 
static GAFAnimatedObjectcreateAndRun (const std::string &gafPath, bool looped=false)
 

Additional Inherited Members

- Protected Member Functions inherited from GAFAnimation
void setAnimationRunning (bool value)
 
bool getIsRunning () const
 
- Protected Attributes inherited from GAFAnimation
GAFAsset_asset
 
int _currentFrameIndex
 

Member Function Documentation

bool GAFAnimatedObject::captureControlOverSubobjectNamed ( const char *  aName,
GAFAnimatedObjectControlFlags  aControlFlags 
)

Takes control over subobject, which means that every frame control delegate will be notified to decide what to do with captured external object

Note
it supports only objects for now, DOES NOT SUPPORT MASKS
Parameters
subobjectname taken from "namedParts" section in config
controlFlagsflags specifying what played will do with subobjects controlled externally
Returns
YES if control was successfully taken and all future

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