mirror of https://github.com/axmolengine/axmol.git
Fixed #4637: Add loop parameter to Animation::initWithSpriteFrames function
This commit is contained in:
parent
610524a6e9
commit
05899d5f6a
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue