void SpriteEaseElasticInOut::onEnter()
{
EaseSpriteDemo::onEnter();
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0));
CCActionInterval* move_ease_inout1 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.3f);
CCActionInterval* move_ease_inout_back1 = move_ease_inout1->reverse();
CCActionInterval* move_ease_inout2 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.45f);
CCActionInterval* move_ease_inout_back2 = move_ease_inout2->reverse();
CCActionInterval* move_ease_inout3 = CCEaseElasticInOut::create((CCActionInterval*)(move->copy()->autorelease()), 0.6f);
CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move_ease_inout1, delay, move_ease_inout_back1, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_inout2, CCCA(delay), move_ease_inout_back2, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_inout3, CCCA(delay), move_ease_inout_back3, CCCA(delay), NULL);
m_tamara->runAction( CCRepeatForever::create((CCActionInterval*)seq1));
m_kathia->runAction( CCRepeatForever::create((CCActionInterval*)seq2));
m_grossini->runAction( CCRepeatForever::create((CCActionInterval*)seq3));
}
'Cocos2d' 카테고리의 다른 글
cocos2d-x CCLabelBMFont로 외부 폰트 출력시 주의해야할 점 (0) | 2012.10.09 |
---|---|
cocos2d-x Sprite의 이미지를 바꾸기 (0) | 2012.08.29 |
cocos2d-x "color type 6" (0) | 2012.08.29 |
cocos2d-x CCTextureCache::sharedTextureCache()->textureForKey() (0) | 2012.08.28 |
cocos2d-x addChild()와 onEnter() (0) | 2012.08.24 |