455 auto batch = SpriteBatchNode::create(
"Images/grossini_dance_atlas.png", 1);
458 auto sprite1 = Sprite::createWithTexture(batch->getTexture(), Rect(85*0, 121*1, 85, 121));
459 auto sprite2 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121));
460 auto sprite3 = Sprite::createWithTexture(batch->getTexture(), Rect(85*2, 121*1, 85, 121));
461 auto sprite4 = Sprite::createWithTexture(batch->getTexture(), Rect(85*3, 121*1, 85, 121));
463 auto sprite5 = Sprite::createWithTexture(batch->getTexture(), Rect(85*0, 121*1, 85, 121));
464 auto sprite6 = Sprite::createWithTexture(batch->getTexture(), Rect(85*1, 121*1, 85, 121));
465 auto sprite7 = Sprite::createWithTexture(batch->getTexture(), Rect(85*2, 121*1, 85, 121));
466 auto sprite8 = Sprite::createWithTexture(batch->getTexture(), Rect(85*3, 121*1, 85, 121));
469 auto s = Director::getInstance()->getWinSize();
470 sprite1->setPosition( Vec2( (s.width/5)*1, (s.height/3)*1) );
471 sprite2->setPosition( Vec2( (s.width/5)*2, (s.height/3)*1) );
472 sprite3->setPosition( Vec2( (s.width/5)*3, (s.height/3)*1) );
473 sprite4->setPosition( Vec2( (s.width/5)*4, (s.height/3)*1) );
474 sprite5->setPosition( Vec2( (s.width/5)*1, (s.height/3)*2) );
475 sprite6->setPosition( Vec2( (s.width/5)*2, (s.height/3)*2) );
476 sprite7->setPosition( Vec2( (s.width/5)*3, (s.height/3)*2) );
477 sprite8->setPosition( Vec2( (s.width/5)*4, (s.height/3)*2) );
479 auto action = FadeIn::create(2);
480 auto action_back = action->reverse();
481 auto fade = RepeatForever::create( Sequence::create( action, action_back,
nullptr) );
483 auto tintred = TintBy::create(2, 0, -255, -255);
484 auto tintred_back = tintred->reverse();
485 auto red = RepeatForever::create( Sequence::create( tintred, tintred_back,
nullptr) );
487 auto tintgreen = TintBy::create(2, -255, 0, -255);
488 auto tintgreen_back = tintgreen->reverse();
489 auto green = RepeatForever::create( Sequence::create( tintgreen, tintgreen_back,
nullptr) );
491 auto tintblue = TintBy::create(2, -255, -255, 0);
492 auto tintblue_back = tintblue->reverse();
493 auto blue = RepeatForever::create( Sequence::create( tintblue, tintblue_back,
nullptr) );
496 sprite5->runAction(red);
497 sprite6->runAction(green);
498 sprite7->runAction(blue);
499 sprite8->runAction(fade);
void removeAndAddSprite(float dt)