Class CCAnimation

#include <Geode/cocos/sprite_nodes/CCAnimation.h>
classCCAnimation:publiccocos2d::CCObject{ ... }

A CCAnimation object is used to perform animations on the CCSprite objects. The CCAnimation object contains CCAnimationFrame objects, and a possible delay between the frames. You can animate a CCAnimation object by using the CCAnimate action. Example: [sprite runAction:[CCAnimate actionWithAnimation:animation]];

Examples0
Public static methods4
staticcocos2d::CCAnimation*create()

Since v0.99.5

Creates an animation

staticcocos2d::CCAnimation*createWithSpriteFrames(
cocos2d::CCArray*arrayOfSpriteFrameNames
,
floatdelay
)
No description provided
staticcocos2d::CCAnimation*create(
cocos2d::CCArray*arrayOfAnimationFrameNames
,
floatdelayPerUnit
,
uintloops
)
No description provided
staticcocos2d::CCAnimation*create(
cocos2d::CCArray*arrayOfAnimationFrameNames
,
floatdelayPerUnit
)
No description provided
Public member functions17
voidaddSpriteFrame()

Adds a CCSpriteFrame to a CCAnimation. The frame will be added with one “delay unit”.

voidaddSpriteFrameWithFileName(
charconst*pszFileName
)

Adds a frame with an image filename. Internally it will create a CCSpriteFrame and it will add it. The frame will be added with one “delay unit”. Added to facilitate the migration from v0.8 to v0.9.

voidaddSpriteFrameWithTexture(,)

Adds a frame with a texture and a rect. Internally it will create a CCSpriteFrame and it will add it. The frame will be added with one “delay unit”. Added to facilitate the migration from v0.8 to v0.9.

boolinit()
No description provided
boolinitWithSpriteFrames(,
floatdelay
)

Since v0.99.5

Initializes a CCAnimation with frames and a delay between frames

boolinitWithAnimationFrames(
cocos2d::CCArray*arrayOfAnimationFrames
,
floatdelayPerUnit
,
uintloops
)

Since v2.0

Initializes a CCAnimation with CCAnimationFrame

virtualcocos2d::CCObject*copyWithZone()
No description provided
virtualfloatgetTotalDelayUnits()const
No description provided
virtualfloatgetDelayPerUnit()const
No description provided
virtualvoidsetDelayPerUnit()
No description provided
virtualfloatgetDuration()
No description provided
virtualcocos2d::CCArray*getFrames()const
No description provided
virtualvoidsetFrames()
No description provided
virtualboolgetRestoreOriginalFrame()const
No description provided
virtualvoidsetRestoreOriginalFrame(
boolvar
)
No description provided
virtualuintgetLoops()const
No description provided
virtualvoidsetLoops(
uintvar
)
No description provided
Fields0
Protected member functions0
Protected fields5
floatm_fTotalDelayUnits
;
No description provided
floatm_fDelayPerUnit
;
No description provided
floatm_fDuration
;
No description provided
boolm_bRestoreOriginalFrame
;
No description provided
uintm_uLoops
;
No description provided