I’m using cocos2d-2.1beta3-x-2.1.1 on win32, I have found a bug.
I want to use CCShakyTiles3D effect on my sprite, but if the sprite is created from CCSpriteBatchNode, there is no effect. But if the sprite is created directly from an image, the effect is OK.
Why ?
CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("TestEffect.plist");
CCSpriteBatchNode *spriteBatchNode = CCSpriteBatchNode::create("TestEffect.png");
CCSprite* pSpriteA = CCSprite::createWithSpriteFrameName("Normal.png");
pSpriteA->setPosition(ccp(winSize.width/2, winSize.height/2));
spriteBatchNode->addChild(pSpriteA, 2);
this->addChild(spriteBatchNode, 1);
// pSpriteA has no shaky effect, just a static image, why????????
CCActionInterval* pShaky1 =CCShakyTiles3D::create(3000, CCSizeMake(50,50), 5, false) ;
pSpriteA->runAction(pShaky1);
CCSprite* pSpriteB = CCSprite::create("NormalB.png");
pSpriteB->setPosition(ccp(winSize.width/2, winSize.height/2 + 200));
this->addChild(pSpriteB, 1);
// pSpriteB has the right shaky effect.
CCActionInterval* pShaky2 =CCShakyTiles3D::create(3000, CCSizeMake(50,50), 5, false) ;
pSpriteB->runAction(pShaky2);