本文整理汇总了C++中CCActionInterval::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ CCActionInterval::copy方法的具体用法?C++ CCActionInterval::copy怎么用?C++ CCActionInterval::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCActionInterval
的用法示例。
在下文中一共展示了CCActionInterval::copy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
void SpriteEaseBack::onEnter()
{
EaseSpriteDemo::onEnter();
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCActionInterval* move = CCMoveBy::create(3, CCPointMake(s.width-130, 0));
CCActionInterval* move_back = move->reverse();
CCActionInterval* move_ease_in = CCEaseBackIn::create((CCActionInterval*)(move->copy()->autorelease()));
CCActionInterval* move_ease_in_back = move_ease_in->reverse();
CCActionInterval* move_ease_out = CCEaseBackOut::create((CCActionInterval*)(move->copy()->autorelease()));
CCActionInterval* move_ease_out_back = move_ease_out->reverse();
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCFiniteTimeAction* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCFiniteTimeAction* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
m_grossini->runAction(CCRepeatForever::create((CCActionInterval*)seq1));
m_tamara->runAction(CCRepeatForever::create((CCActionInterval*)seq2));
m_kathia->runAction(CCRepeatForever::create((CCActionInterval*)seq3));
}
示例2: onEnter
void SpriteEase::onEnter()
{
EaseSpriteDemo::onEnter();
CCActionInterval* move = CCMoveBy::create(3, ccp(VisibleRect::right().x-130,0));
CCActionInterval* move_back = move->reverse();
CCActionInterval* move_ease_in = CCEaseIn::create((CCActionInterval*)(move->copy()->autorelease()), 2.5f);
CCActionInterval* move_ease_in_back = move_ease_in->reverse();
CCActionInterval* move_ease_out = CCEaseOut::create((CCActionInterval*)(move->copy()->autorelease()), 2.5f);
CCActionInterval* move_ease_out_back = move_ease_out->reverse();
CCDelayTime *delay = CCDelayTime::create(0.25f);
CCSequence* seq1 = CCSequence::create(move, delay, move_back, CCCA(delay), NULL);
CCSequence* seq2 = CCSequence::create(move_ease_in, CCCA(delay), move_ease_in_back, CCCA(delay), NULL);
CCSequence* seq3 = CCSequence::create(move_ease_out, CCCA(delay), move_ease_out_back, CCCA(delay), NULL);
CCAction *a2 = m_grossini->runAction(CCRepeatForever::create(seq1));
a2->setTag(1);
CCAction *a1 = m_tamara->runAction(CCRepeatForever::create(seq2));
a1->setTag(1);
CCAction *a = m_kathia->runAction(CCRepeatForever::create(seq3));
a->setTag(1);
schedule(schedule_selector(SpriteEase::testStopAction), 6.25f);
}
示例3: setContentAccess
//SetContentAccess
//state
//1 - active
//2 - passive
void CurrentGroupLayer::setContentAccess(bool state)
{
CCLayer* spr = (CCLayer*)this->getChildByTag(ID_CONTROLLAYER);
spr->stopAllActions();
CCActionInterval* scalein = CCScaleTo::actionWithDuration(0.2f,1.2f,1.2f);
CCActionInterval* scaleout = CCScaleTo::actionWithDuration(0.2f,1.0f,1.0f);
CCActionInterval* fadetoin = CCFadeTo::actionWithDuration(0.2f,255);
CCActionInterval* fadetoout = CCFadeTo::actionWithDuration(0.2f,180);
if(state)
{
((CCSprite*)(spr->getChildByTag(ID_TEXTFIELD)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_COLORBOX)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_STRIPE)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoin->copy()->autorelease(),2.0f));
spr->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)scalein->copy()->autorelease(),2.0f));
m_isAccessable = true;
} else {
((CCSprite*)(spr->getChildByTag(ID_TEXTFIELD)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_COLORBOX)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
((CCSprite*)(spr->getChildByTag(ID_STRIPE)))->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)fadetoout->copy()->autorelease(),2.0f));
spr->runAction(CCEaseInOut::actionWithAction((CCActionInterval*)scaleout->copy()->autorelease(),2.0f));
//hide keyboard
this->onClickTrackNode(0);
m_isAccessable = false;
}
}
示例4: ccp
//------------------------------------------------------------------
//
// StressTest2
//
//------------------------------------------------------------------
StressTest2::StressTest2()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
CCLayer* sublayer = CCLayer::create();
CCSprite *sp1 = CCSprite::create(s_pPathSister1);
sp1->setPosition( ccp(80, s.height/2) );
CCActionInterval* move = CCMoveBy::create(3, ccp(350,0));
CCActionInterval* move_ease_inout3 = CCEaseInOut::create((CCActionInterval*)(move->copy()->autorelease()), 2.0f);
CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();
CCSequence* seq3 = CCSequence::create( move_ease_inout3, move_ease_inout_back3, NULL);
sp1->runAction( CCRepeatForever::create(seq3) );
sublayer->addChild(sp1, 1);
CCParticleFire* fire = CCParticleFire::create();
fire->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png"));
fire->setPosition( ccp(80, s.height/2-50) );
CCActionInterval* copy_seq3 = (CCActionInterval*)(seq3->copy()->autorelease());
fire->runAction( CCRepeatForever::create(copy_seq3) );
sublayer->addChild(fire, 2);
schedule(schedule_selector(StressTest2::shouldNotLeak), 6.0f);
addChild(sublayer, 0, kTagSprite1);
}
示例5: init
bool SplashScreen::init()
{
if (!CCLayer::init()) {
return false;
}
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCSprite *logo = CCSprite::create("logo.png");
logo->setOpacity(0);
logo->setPosition(VisibleRect::center());
CCSprite *splash = CCSprite::create("splash.png");
CCSize splashSize = splash->getContentSize();
splash->setOpacity(0);
splash->setPosition(VisibleRect::center());
CCActionInterval *fadeIn = CCFadeIn::create(0.5f);
CCCallFunc *loadHandler = CCCallFunc::create(this, callfunc_selector(SplashScreen::__loadAssets));
CCActionInterval *delayAct = CCDelayTime::create(1.0f);
CCActionInterval *fadeOut = CCFadeOut::create(0.5f);
CCCallFunc *startHandler = CCCallFunc::create(this, callfunc_selector(SplashScreen::__startGame));
CCSequence *splashSeq = CCSequence::create(fadeIn,loadHandler,delayAct,fadeOut,startHandler,NULL);
addChild(splash);
addChild(logo);
splash->setScaleX(winSize.width/splashSize.width);
logo->setScale(winSize.width/splashSize.width);
splash->setScaleY(winSize.height/splashSize.height);
logo->runAction(splashSeq);
splash->runAction((CCActionInterval*)fadeIn->copy());
return true;
}
示例6: getChildByTag
//------------------------------------------------------------------
//
// Effect2
//
//------------------------------------------------------------------
void Effect2::onEnter()
{
EffectAdvanceTextLayer::onEnter();
CCNode* target = getChildByTag(kTagBackground);
// To reuse a grid the grid size and the grid type must be the same.
// in this case:
// ShakyTiles is TiledGrid3D and it's size is (15,10)
// Shuffletiles is TiledGrid3D and it's size is (15,10)
// TurnOfftiles is TiledGrid3D and it's size is (15,10)
CCActionInterval* shaky = CCShakyTiles3D::create(5, CCSizeMake(15,10), 4, false);
CCActionInterval* shuffle = CCShuffleTiles::create(0, CCSizeMake(15,10), 3);
CCActionInterval* turnoff = CCTurnOffTiles::create(0, CCSizeMake(15,10), 3);
CCActionInterval* turnon = turnoff->reverse();
// reuse 2 times:
// 1 for shuffle
// 2 for turn off
// turnon tiles will use a new grid
CCFiniteTimeAction* reuse = CCReuseGrid::create(2);
CCActionInterval* delay = CCDelayTime::create(1);
// id orbit = [OrbitCamera::create:5 radius:1 deltaRadius:2 angleZ:0 deltaAngleZ:180 angleX:0 deltaAngleX:-90];
// id orbit_back = [orbit reverse];
//
// [target runAction: [RepeatForever::create: [Sequence actions: orbit, orbit_back, nil]]];
target->runAction(CCSequence::create( shaky, delay, reuse, shuffle, delay->copy()->autorelease(), turnoff, turnon, NULL) );
}
示例7: onEnter
void SpriteEase::onEnter()
{
EaseSpriteDemo::onEnter();
CCActionInterval* move = CCMoveBy::actionWithDuration(3, CCPointMake(350,0) );
CCActionInterval* move_back = move->reverse();
CCActionInterval* move_ease_in = (CCActionInterval*)CCEaseIn::actionWithAction((CCActionInterval*)(move->copy()->autorelease()), 3.0f);
CCActionInterval* move_ease_in_back = move_ease_in->reverse();
CCActionInterval* move_ease_out = CCEaseOut::actionWithAction((CCActionInterval*)(move->copy()->autorelease()), 3.0f);
CCActionInterval* move_ease_out_back = move_ease_out->reverse();
CCFiniteTimeAction* seq1 = CCSequence::actions(move, move_back, NULL);
CCFiniteTimeAction* seq2 = CCSequence::actions(move_ease_in, move_ease_in_back, NULL);
CCFiniteTimeAction* seq3 = CCSequence::actions(move_ease_out, move_ease_out_back, NULL);
CCAction *a2 = m_grossini->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq1) );
a2->setTag(1);
CCAction *a1 = m_tamara->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq2) );
a1->setTag(1);
CCAction *a = m_kathia->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq3) );
a->setTag(1);
schedule(schedule_selector(SpriteEase::testStopAction), 6);
}
示例8: spark
KDvoid spark ( const CCPoint& tPosition, CCNode* pParent, KDfloat fScale, KDfloat fDuration )
{
fScale = KD_MAX ( fScale, 0.3f );
fDuration = KD_MAX ( fDuration, 0.5f );
CCSprite* pSprite1 = CCSprite::create ( PATH_IMAGE_EXPLODE1 );
CCSprite* pSprite2 = CCSprite::create ( PATH_IMAGE_EXPLODE2 );
CCSprite* pSprite3 = CCSprite::create ( PATH_IMAGE_EXPLODE3 );
pParent->addChild ( pSprite1 );
pParent->addChild ( pSprite2 );
pParent->addChild ( pSprite3 );
pSprite1->setPosition ( tPosition );
pSprite2->setPosition ( tPosition );
pSprite3->setPosition ( tPosition );
pSprite1->setScale ( fScale );
pSprite2->setScale ( fScale );
pSprite3->setScale ( fScale );
pSprite3->setRotation ( CCRANDOM_0_1 ( ) * 360.f );
CCActionInterval* pLeft = CCRotateBy::create ( fDuration, -45 );
CCActionInterval* pRight = CCRotateBy::create ( fDuration, 45 );
CCActionInterval* pScaleBy = CCScaleBy::create ( fDuration, 3 );
CCActionInterval* pFadeOut = CCFadeOut::create ( fDuration );
pSprite1->runAction ( CCSequence::createWithTwoActions
(
CCSpawn::create ( pLeft, pScaleBy, pFadeOut, KD_NULL ),
CCCallFunc::create ( pSprite1, callfunc_selector ( CCNode::removeFromParentAndCleanup ) )
) );
pSprite2->runAction ( CCSequence::createWithTwoActions
(
CCSpawn::create ( pRight, pScaleBy->copy ( ), pFadeOut->copy ( ), KD_NULL ),
CCCallFunc::create ( pSprite2, callfunc_selector ( CCNode::removeFromParentAndCleanup ) )
) );
pSprite3->runAction ( CCSequence::createWithTwoActions
(
CCSpawn::create ( (CCFiniteTimeAction*) pScaleBy->copy ( ), pFadeOut->copy ( ), KD_NULL ),
CCCallFunc::create ( pSprite3, callfunc_selector ( CCNode::removeFromParentAndCleanup ) )
) );
}
示例9: onEnterTransitionDidFinish
void PauseLayer::onEnterTransitionDidFinish() {
setTouchEnabled(true);
CCPoint delta = ccp(winSize.width / 2, winSize.height - 500)
- pMenusResume->getPosition();
CCActionInterval* move = CCMoveBy::create(0.5, delta);
CCActionInterval* move_ease_out = CCEaseBackOut::create(
(CCActionInterval*) (move->copy()->autorelease()));
pMenusResume->runAction(CCSequence::create(move_ease_out, NULL));
delta = ccp(winSize.width / 2, winSize.height - 780)
- pMenusBackToMenu->getPosition();
move = CCMoveBy::create(0.5, delta);
move_ease_out = CCEaseBackOut::create(
(CCActionInterval*) (move->copy()->autorelease()));
pMenusBackToMenu->runAction(CCSequence::create(move_ease_out, NULL));
pMenusResume->runAction(CCSequence::create(CCFadeIn::create(0.5f), NULL));
pMenusSetting->runAction(CCSequence::create(CCFadeIn::create(0.5f), NULL));
pMenusBackToMenu->runAction(
CCSequence::create(CCFadeIn::create(0.5f), NULL));
}
示例10: resume
void PauseLayer::resume() {
CCPoint delta = ccp(winSize.width / 2, winSize.height + 57 / 2)
- pMenusResume->getPosition();
CCActionInterval* move = CCMoveBy::create(0.5, delta);
CCActionInterval* move_ease_in = CCEaseBackIn::create(
(CCActionInterval*) (move->copy()->autorelease()));
pMenusResume->runAction(CCSequence::create(move_ease_in, NULL));
delta = ccp(winSize.width / 2, -57 / 2) - pMenusBackToMenu->getPosition();
move = CCMoveBy::create(0.5, delta);
move_ease_in = CCEaseBackIn::create(
(CCActionInterval*) (move->copy()->autorelease()));
pMenusBackToMenu->runAction(CCSequence::create(move_ease_in, NULL));
pMenusResume->runAction(CCSequence::create(CCFadeOut::create(0.5f), NULL));
pMenusSetting->runAction(CCSequence::create(CCFadeOut::create(0.5f), NULL));
pMenusBackToMenu->runAction(
CCSequence::create(CCFadeOut::create(0.5f),
CCCallFunc::create(this,
callfunc_selector(PauseLayer::popToGameLayer)),
NULL));
}
示例11: onEnter
//------------------------------------------------------------------
//
// ActionRotateToRepeat
//
//------------------------------------------------------------------
void ActionRotateToRepeat::onEnter()
{
ActionsDemo::onEnter();
centerSprites(2);
CCActionInterval* act1 = CCRotateTo::actionWithDuration(1, 90);
CCActionInterval* act2 = CCRotateTo::actionWithDuration(1, 0);
CCActionInterval* seq = (CCActionInterval*)(CCSequence::actions(act1, act2, NULL));
CCAction* rep1 = CCRepeatForever::actionWithAction(seq);
CCActionInterval* rep2 = CCRepeat::actionWithAction((CCFiniteTimeAction*)(seq->copy()->autorelease()), 10);
m_tamara->runAction(rep1);
m_kathia->runAction(rep2);
}
示例12: onEnter
void SpriteEaseBack::onEnter()
{
EaseSpriteDemo::onEnter();
CCActionInterval* move = CCMoveBy::actionWithDuration(3, CGPointMake(350,0));
CCActionInterval* move_back = move->reverse();
CCActionInterval* move_ease_in = CCEaseBackIn::actionWithAction((CCActionInterval*)(move->copy()->autorelease()) );
CCActionInterval* move_ease_in_back = move_ease_in->reverse();
CCActionInterval* move_ease_out = CCEaseBackOut::actionWithAction((CCActionInterval*)(move->copy()->autorelease()) );
CCActionInterval* move_ease_out_back = move_ease_out->reverse();
CCFiniteTimeAction* seq1 = CCSequence::actions( move, move_back, NULL);
CCFiniteTimeAction* seq2 = CCSequence::actions( move_ease_in, move_ease_in_back, NULL);
CCFiniteTimeAction* seq3 = CCSequence::actions( move_ease_out, move_ease_out_back, NULL);
m_grossini->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq1));
m_tamara->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq2));
m_kathia->runAction( CCRepeatForever::actionWithAction((CCActionInterval*)seq3));
}
示例13: InitSprites
void T_NoImage::InitSprites()
{
pBlack = CCSprite::create("images/ranking_scrollbg.png", CCRectMake(0, 0, winSize.width, winSize.height));
pBlack->setPosition(ccp(0, 0));
pBlack->setAnchorPoint(ccp(0, 0));
pBlack->setColor(ccc3(0, 0, 0));
pBlack->setOpacity(150);
this->addChild(pBlack, 0);
spriteClass = new SpriteClass();
// pop-up 배경
spriteClass->spriteObj.push_back( SpriteObject::Create(1, "background/bg_board_brown.png", ccp(0, 0), ccp(49, 640), CCSize(982, 623), "", "T_NoImage", this, 1) );
spriteClass->spriteObj.push_back( SpriteObject::Create(1, "background/bg_board_yellow.png", ccp(0, 0), ccp(76, 678), CCSize(929, 562), "", "T_NoImage", this, 1) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "background/bg_popup_rightup.png", ccp(0, 0), ccp(809, 1039), CCSize(0, 0), "", "T_NoImage", this, 1) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "button/btn_x_brown.png", ccp(0, 0), ccp(900, 1132), CCSize(0, 0), "", "T_NoImage", this, 1) );
// text
char text[250];
std::string title = "마법 배우기";
sprintf(text, "축하해요! '%s' 마법을 새로 배웠어요!", SkillInfo::GetSkillInfo(d[0])->GetName().c_str());
// 내용 문장
spriteClass->spriteObj.push_back( SpriteObject::CreateLabelArea(text, fontList[0], 40, ccp(0.5, 0.5), ccp(winSize.width/2, winSize.height/2), ccc3(78,47,8), CCSize(829-20, 250), kCCTextAlignmentCenter, kCCVerticalTextAlignmentCenter, "", "T_NoImage", this, 5) );
// 팝업창 타이틀
spriteClass->spriteObj.push_back( SpriteObject::Create(1, "background/bg_degree_desc.png", ccp(0, 1), ccp(126+5, 678+562- 35), CCSize(759-126+52, 90), "", "T_NoImage", this, 1) );
CCPoint pos = spriteClass->FindParentCenterPos("background/bg_degree_desc.png");
spriteClass->spriteObj.push_back( SpriteObject::CreateLabel(title, fontList[0], 48, ccp(0.5,0.5), ccp(pos.x+2, pos.y+3-1), ccc3(0,0,0), "background/bg_degree_desc.png", "1", NULL, 2, 1) );
spriteClass->spriteObj.push_back( SpriteObject::CreateLabel(title, fontList[0], 48, ccp(0.5,0.5), ccp(pos.x, pos.y+3), ccc3(242,242,242), "background/bg_degree_desc.png", "1", NULL, 2, 1) );
// 확인 버튼
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "button/btn_red_mini.png", ccp(0, 0), ccp(717+5, 711), CCSize(0, 0), "", "T_NoImage", this, 5) );
spriteClass->spriteObj.push_back( SpriteObject::Create(0, "letter/letter_confirm_mini.png",ccp(0.5, 0), ccp(spriteClass->spriteObj[spriteClass->spriteObj.size()-1]->sprite->getContentSize().width/2, 24), CCSize(0, 0), "button/btn_red_mini.png", "0", NULL, 5, 1) );
// 버튼 젤리 움직임
CCSprite* temp = ((CCSprite*)spriteClass->FindSpriteByName("button/btn_red_mini.png"));
CCSize t = temp->getContentSize();
temp->setAnchorPoint(ccp(0.5, 0.5));
temp->setPosition(ccp(temp->getPosition().x+t.width/2, temp->getPosition().y+t.height/2));
CCActionInterval* action = CCSequence::create( CCScaleTo::create(1.0f, 1.02f, 0.97f), CCScaleTo::create(1.0f, 0.98f, 1.03f), NULL );
temp->runAction(CCRepeatForever::create(action));
((CCSprite*)spriteClass->FindSpriteByName("letter/letter_confirm_mini.png"))->runAction(CCRepeatForever::create((CCActionInterval*)action->copy()));
for (int i = 0 ; i < spriteClass->spriteObj.size() ; i++)
spriteClass->AddChild(i);
}
示例14: showView
void MenuScene::showView(MenuViewType menuViewType)
{
CCRect visibleRect = VisibleRect::getVisibleRect();
CCActionInterval* moveLeft = CCMoveBy::create(.3f, ccp(-(visibleRect.size.width),0));
CCActionInterval* moveRight = CCMoveBy::create(.3f, ccp((visibleRect.size.width),0));
CCPoint center = VisibleRect::center();
float easeRate = .5f;
float posLeft = center.x - visibleRect.size.width;
float posRight = center.x + visibleRect.size.width;
m_header->setVisible(true);
switch(menuViewType)
{
case HOME:
switch (m_menuViewType)
{
case STORY_MODE:
resetHomeButtons(true);
resetArcadeButtons(false);
m_challengeButtonPanel->hide();
m_homeStoryMode->setPositionX(center.x);
m_homeArcade->setPositionX(center.x);
m_homeOptions->setPositionX(center.x);
m_homeHighscore->setPositionX(center.x);
break;
case ARCADE:
resetHomeButtons(true);
resetArcadeButtons(true);
m_challengeButtonPanel->hide();
m_homeStoryMode->setPositionX(posLeft);
m_homeArcade->setPositionX(posLeft);
m_homeOptions->setPositionX(posLeft);
m_homeHighscore->setPositionX(posLeft);
m_homeStoryMode->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_homeArcade->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_homeOptions->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_homeHighscore->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_arcadeEasy->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_arcadeNormal->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
m_arcadeHard->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
m_arcadeBack->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveRight->copy()->autorelease()), easeRate), NULL));
#endif
break;
}
break;
case ARCADE:
resetHomeButtons(true);
resetArcadeButtons(true);
m_challengeButtonPanel->hide();
m_homeStoryMode->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_homeArcade->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_homeOptions->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_homeHighscore->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_arcadeEasy->setPositionX(posRight);
m_arcadeNormal->setPositionX(posRight);
m_arcadeHard->setPositionX(posRight);
m_arcadeEasy->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_arcadeNormal->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
m_arcadeHard->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
m_arcadeBack->runAction(CCSequence::create(CCEaseIn::create((CCActionInterval*)(moveLeft->copy()->autorelease()), easeRate), NULL));
#endif
break;
case STORY_MODE:
resetHomeButtons(false);
resetArcadeButtons(false);
m_header->setVisible(false);
m_challengeButtonPanel->show();
m_challengeButtonPanel->reset();
break;
}
m_menuViewType = menuViewType;
}
示例15: init
bool CSPlayerControlLayer::init()
{
CCSize size = CCDirector::sharedDirector()->getWinSize();
//玩家信息-头像、钱、同谋、资产 CSPlayerInfo
int nTemp = 0;
map<int ,USER>::iterator iter;
CSPlayerInfoSprite *pPlayer;
for (iter = DataManager::sharedDataManager()->m_mapPlayer.begin(); iter != DataManager::sharedDataManager()->m_mapPlayer.end(); iter++, nTemp++)
{
pPlayer = CSPlayerInfoSprite::spriteWithPlayer(&(*iter).second);
addChild(pPlayer, ZORDER_DEFAULT);
pPlayer->setPosition(ccp(50 + size.width*nTemp/4, size.height - 80));
if (DataManager::sharedDataManager()->getCurrentUserID() == (*iter).first)
{
m_pPlayer = pPlayer;
}
}
//货船进度 CSRulerInfo
m_pRuleInfo = CSRulerInfo::node();
addChild(m_pRuleInfo, ZORDER_DEFAULT);
//股市 CSStockMarketInfo
if(DataManager::sharedDataManager()->xmlStockMarketVisible())
{
m_pStockMarketInfo = CSStockMarketInfo::node();
m_pStockMarketInfo->setPosition(CCPointZero);
addChild(m_pStockMarketInfo, ZORDER_DEFAULT);
}
CCMenu *pMenu = CCMenu::menuWithItem(NULL);
addChild(pMenu);
pMenu->setPosition(CCPointZero);
m_pSandglass = CCSprite::spriteWithSpriteFrameName("sandglass.png");
addChild(m_pSandglass, 0);
m_pSandglass->setPosition(ccp(size.width - 20, size.height - 20));
m_pImageItemHelp = CSMenuItem::itemFromNormalImage("help.png", "help.png", this, menu_selector(CSPlayerControlLayer::restartLevel));
pMenu->addChild(m_pImageItemHelp, 0);
m_pImageItemHelp->setPosition(ccp(size.width - 20, size.height - 60));
m_pImageItemWallet = CSMenuItem::itemFromNormalImage("wallet.png", "wallet.png", this, menu_selector(CSPlayerControlLayer::transaction));
pMenu->addChild(m_pImageItemWallet, 0);
m_pImageItemWallet->setPosition(ccp(size.width - 20, 40));
//启航按钮
m_pRudderMenuItem = CSRudderMenuItem::itemFromSprite(this, menu_selector(CSPlayerControlLayer::callbackNextRound));
pMenu->addChild(m_pRudderMenuItem, 0);
m_pRudderMenuItem->setPosition(ccp(m_pRudderMenuItem->getContentSize().width/2, m_pRudderMenuItem->getContentSize().height/2 + m_pRuleInfo->getContentSize().height));
m_pLabel = CCLabelTTF::labelWithString("", "Arial", 22);
m_pLabel->setColor(ccORANGE);
addChild(m_pLabel, ZORDER_HIGHEST, kTagLabel);
m_pLabel->runAction(CCFadeOut::actionWithDuration(0));
CCActionInterval* move = CCMoveBy::actionWithDuration(0.05, CCPointMake(5,0));
CCActionInterval* move_ease_inout3 = CCEaseInOut::actionWithAction((CCActionInterval*)(move->copy()->autorelease()), 2.0f);
CCActionInterval* move_ease_inout_back3 = move_ease_inout3->reverse();
CCFiniteTimeAction* seq1 = CCSequence::actions( move_ease_inout3, move_ease_inout_back3, NULL);
CCFiniteTimeAction* repeat = CCRepeat::actionWithAction(seq1, 3);
CCFiniteTimeAction* seq2 = CCSequence::actions( repeat, CCDelayTime::actionWithDuration(2+CCRANDOM_0_1()), NULL);
m_action = CCRepeatForever::actionWithAction((CCActionInterval*)seq2);
CC_SAFE_RETAIN(m_action);
m_nSequence = 0;
NextTips(NULL);
return true;
}