Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation runs slowly on a sprite despite setting CCAnimation object's setDelayperUnit to lowest value #27

Open
saudahmed opened this issue Apr 10, 2013 · 0 comments

Comments

@saudahmed
Copy link

Bug: I have created a simple coin animation that executes perfectly but the delay between the frames remains the same whether I have set the delayPerUnit. Infact the delay is quite low and the frames changed very slowly. Here is my sample code that I have tried with and without CCSpriteBatchNode the results are the same.

CCSize size = CCDirector::sharedDirector()->getWinSize();

CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("coin-sprite-sheet.plist");

CCSpriteBatchNode * batchNode = CCSpriteBatchNode::create("coin-sprite-sheet.png");

this->addChild(batchNode);

CCArray * spriteFrames = CCArray::create(CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("coin-1.png"),
CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("coin-2.png"),
CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("coin-3.png"),
CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName("coin-4.png"),
NULL);

CCAnimation* animation = CCAnimation::createWithSpriteFrames(spriteFrames);
animation->setDelayPerUnit(0.6); <---- change here to any value no effect

CCSprite * sprite_ = CCSprite::createWithSpriteFrameName("coin-1.png");
sprite_->setPosition(ccp(size.width/2,size.height/2));

batchNode->addChild(sprite_, 10);

CCRepeatForever * rep = CCRepeatForever::create(CCAnimate::create(animation, true));
sprite_->runAction(rep);

I believe it's a bug in cocos2dx-WindowsPhone. And on cocos2dx-Windows ccanimate action never runs and crashes. I am using currently this http://github.com/qima/cocos2d-windowsphone and also cocos2d-Windows for api 2.1. Please have you added a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant