Fixed #4637: Add loop parameter to Animation::initWithSpriteFrames function

This commit is contained in:
pandamicro 2014-04-02 11:48:49 +08:00
parent 610524a6e9
commit 05899d5f6a
2 changed files with 3 additions and 3 deletions

View File

@ -118,10 +118,10 @@ bool Animation::init()
return true;
}
bool Animation::initWithSpriteFrames(const Vector<SpriteFrame*>& frames, float delay/* = 0.0f*/)
bool Animation::initWithSpriteFrames(const Vector<SpriteFrame*>& frames, float delay, unsigned int loops)
{
_loops = 1;
_delayPerUnit = delay;
_loops = loops;
for (auto& spriteFrame : frames)
{

View File

@ -224,7 +224,7 @@ CC_CONSTRUCTOR_ACCESS:
/** Initializes a Animation with frames and a delay between frames
@since v0.99.5
*/
bool initWithSpriteFrames(const Vector<SpriteFrame*>& arrayOfSpriteFrameNames, float delay = 0.0f);
bool initWithSpriteFrames(const Vector<SpriteFrame*>& arrayOfSpriteFrameNames, float delay = 0.0f, unsigned int loops = 1);
/** Initializes a Animation with AnimationFrame
@since v2.0