cocos2dx Beta 使用动画

void WelcomeLayer::soundAnimation(Node* node)
{
	//Array* frames  = Array::create();
	Vector<SpriteFrame*> frames;
	SpriteFrame* frame1= SpriteFrameCache::getInstance()->getSpriteFrameByName("soundOn0000.png");
	SpriteFrame* frame2 =  SpriteFrameCache::getInstance()->getSpriteFrameByName("soundOn0001.png");
	SpriteFrame* frame3 =  SpriteFrameCache::getInstance()->getSpriteFrameByName("soundOn0002.png");
	frames.insert(0, frame1);
	frames.insert(1, frame2);
	frames.insert(2, frame3);

	
	Animation* fly =  Animation::createWithSpriteFrames(frames,0.2f);
	Sequence* taskList= Sequence::create(Animate::create(fly),NULL);
	node->runAction( RepeatForever::create(taskList) );
}

你可能感兴趣的:(cocos2dx Beta 使用动画)