本文整理汇总了C++中CCSpeed::setTag方法的典型用法代码示例。如果您正苦于以下问题:C++ CCSpeed::setTag方法的具体用法?C++ CCSpeed::setTag怎么用?C++ CCSpeed::setTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCSpeed
的用法示例。
在下文中一共展示了CCSpeed::setTag方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onEnter
void SpeedTest::onEnter()
{
EaseSpriteDemo::onEnter();
// rotate and jump
CCActionInterval *jump1 = CCJumpBy::actionWithDuration(4, CCPointMake(-400,0), 100, 4);
CCActionInterval *jump2 = jump1->reverse();
CCActionInterval *rot1 = CCRotateBy::actionWithDuration(4, 360*2);
CCActionInterval *rot2 = rot1->reverse();
CCFiniteTimeAction* seq3_1 = CCSequence::actions(jump2, jump1, NULL);
CCFiniteTimeAction* seq3_2 = CCSequence::actions( rot1, rot2, NULL);
CCFiniteTimeAction* spawn = CCSpawn::actions(seq3_1, seq3_2, NULL);
CCSpeed* action = CCSpeed::actionWithAction(CCRepeatForever::actionWithAction((CCActionInterval*)spawn), 1.0f);
action->setTag(kTagAction1);
CCAction* action2 = (CCAction*)(action->copy()->autorelease());
CCAction* action3 = (CCAction*)(action->copy()->autorelease());
action2->setTag(kTagAction1);
action3->setTag(kTagAction1);
m_grossini->runAction( action2 );
m_tamara->runAction( action3 );
m_kathia->runAction( action );
this->schedule(schedule_selector(SpeedTest::altertime), 1.0f);//:@selector(altertime:) interval:1.0f];
}
示例2: onEnter
void SpeedTest::onEnter()
{
EaseSpriteDemo::onEnter();
CCSize s = CCDirector::sharedDirector()->getWinSize();
// rotate and jump
CCActionInterval *jump1 = CCJumpBy::create(4, ccp(-s.width+80, 0), 100, 4);
CCActionInterval *jump2 = jump1->reverse();
CCActionInterval *rot1 = CCRotateBy::create(4, 360*2);
CCActionInterval *rot2 = rot1->reverse();
CCSequence* seq3_1 = CCSequence::create(jump2, jump1, NULL);
CCSequence* seq3_2 = CCSequence::create( rot1, rot2, NULL);
CCSpawn* spawn = CCSpawn::create(seq3_1, seq3_2, NULL);
CCSpeed* action = CCSpeed::create(CCRepeatForever::create(spawn), 1.0f);
action->setTag(kTagAction1);
CCAction* action2 = (CCAction*)(action->copy()->autorelease());
CCAction* action3 = (CCAction*)(action->copy()->autorelease());
action2->setTag(kTagAction1);
action3->setTag(kTagAction1);
m_grossini->runAction(action2);
m_tamara->runAction(action3);
m_kathia->runAction(action);
this->schedule(schedule_selector(SpeedTest::altertime), 1.0f);//:@selector(altertime:) interval:1.0f];
}
示例3: onEnter
KDvoid SpeedTest::onEnter ( KDvoid )
{
TestEaseActions::onEnter ( );
CCSize s = this->getContentSize ( );
// rotate and jump
CCActionInterval *jump1 = CCJumpBy::create(4, ccp(-s.cx+80, 0), 100, 4);
CCActionInterval *jump2 = jump1->reverse();
CCActionInterval *rot1 = CCRotateBy::create(4, 360*2);
CCActionInterval *rot2 = rot1->reverse();
CCSequence* seq3_1 = CCSequence::create(jump2, jump1, KD_NULL);
CCSequence* seq3_2 = CCSequence::create( rot1, rot2, KD_NULL);
CCSpawn* spawn = CCSpawn::create(seq3_1, seq3_2, KD_NULL);
CCSpeed* action = CCSpeed::create(CCRepeatForever::create ( spawn), 1.0f);
action->setTag(kTagAction1);
CCAction* action2 = (CCAction*)(action->copy()->autorelease( ) );
CCAction* action3 = (CCAction*)(action->copy()->autorelease( ) );
action2->setTag(kTagAction1);
action3->setTag(kTagAction1);
m_grossini->runAction(action2);
m_tamara->runAction(action3);
m_kathia->runAction(action);
this->schedule(schedule_selector(SpeedTest::altertime), 1.0f);
}