当前位置: 首页>>代码示例>>C++>>正文


C++ CCSpeed::setTag方法代码示例

本文整理汇总了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];
}
开发者ID:ccjimmy,项目名称:TweeJump4wp8,代码行数:28,代码来源:EaseActionsTest.cpp

示例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];
}
开发者ID:645286681,项目名称:cocos2d-x,代码行数:30,代码来源:ActionsEaseTest.cpp

示例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);
}
开发者ID:mcodegeeks,项目名称:OpenKODE-Framework,代码行数:30,代码来源:TestEaseActions.cpp


注:本文中的CCSpeed::setTag方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。