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


C++ CCJumpBy::reverse方法代码示例

本文整理汇总了C++中CCJumpBy::reverse方法的典型用法代码示例。如果您正苦于以下问题:C++ CCJumpBy::reverse方法的具体用法?C++ CCJumpBy::reverse怎么用?C++ CCJumpBy::reverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCJumpBy的用法示例。


在下文中一共展示了CCJumpBy::reverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CCPointMake

IntervalLayer::IntervalLayer()
{
	m_time0 = m_time1 = m_time2 = m_time3 = m_time4 = 0.0f;

	CCSize s = CCDirector::sharedDirector()->getWinSize();
	// sun
	CCParticleSystem* sun = CCParticleSun::node();
    sun->setTexture(CCTextureCache::sharedTextureCache()->addImage("Images/fire.png"));
	sun->setPosition( CCPointMake(s.width-32,s.height-32) );

	sun->setTotalParticles(130);
	sun->setLife(0.6f);
	this->addChild(sun);

	// timers
    m_label0 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
	m_label1 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
	m_label2 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
	m_label3 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");
    m_label4 = CCLabelBMFont::labelWithString("0", "fonts/bitmapFontTest4.fnt");

    scheduleUpdate();
	schedule(schedule_selector(IntervalLayer::step1));
	schedule(schedule_selector(IntervalLayer::step2), 0);
	schedule(schedule_selector(IntervalLayer::step3), 1.0f);
    schedule(schedule_selector(IntervalLayer::step4), 2.0f);

    m_label0->setPosition(CCPointMake(s.width*1/6, s.height/2));
	m_label1->setPosition(CCPointMake(s.width*2/6, s.height/2));
	m_label2->setPosition(CCPointMake(s.width*3/6, s.height/2));
	m_label3->setPosition(CCPointMake(s.width*4/6, s.height/2));
    m_label4->setPosition(CCPointMake(s.width*5/6, s.height/2));

    addChild(m_label0);
	addChild(m_label1);
	addChild(m_label2);
	addChild(m_label3);
    addChild(m_label4);

	// Sprite
	CCSprite* sprite = CCSprite::spriteWithFile(s_pPathGrossini);
	sprite->setPosition( CCPointMake(40,50) );
	
	CCJumpBy* jump = CCJumpBy::actionWithDuration(3, CCPointMake(s.width-80,0), 50, 4);
	
	addChild(sprite);
	sprite->runAction( CCRepeatForever::actionWithAction(
															(CCActionInterval*)(CCSequence::actions(jump, jump->reverse(), NULL ))
														)
					 );
	// pause button
	CCMenuItem* item1 = CCMenuItemFont::itemFromString("Pause", this, menu_selector(IntervalLayer::onPause) );
	CCMenu* menu = CCMenu::menuWithItems(item1, NULL);
	menu->setPosition( CCPointMake(s.width/2, s.height-50) );

	addChild( menu );
}
开发者ID:ccjimmy,项目名称:TweeJump4wp8,代码行数:57,代码来源:IntervalTest.cpp

示例2: CCRectMake

//------------------------------------------------------------------
//
// MenuLayer3
//
//------------------------------------------------------------------
MenuLayer3::MenuLayer3()
{
    CCMenuItemFont::setFontName("Marker Felt");
    CCMenuItemFont::setFontSize(28);

    CCLabelBMFont* label = CCLabelBMFont::create("Enable AtlasItem", "fonts/bitmapFontTest3.fnt");
    CCMenuItemLabel* item1 = CCMenuItemLabel::create(label, this, menu_selector(MenuLayer3::menuCallback2) );
    CCMenuItemFont* item2 = CCMenuItemFont::create("--- Go Back ---", this, menu_selector(MenuLayer3::menuCallback) );
    
    CCSprite *spriteNormal   = CCSprite::create(s_MenuItem,  CCRectMake(0,23*2,115,23));
    CCSprite *spriteSelected = CCSprite::create(s_MenuItem,  CCRectMake(0,23*1,115,23));
    CCSprite *spriteDisabled = CCSprite::create(s_MenuItem,  CCRectMake(0,23*0,115,23));
    
    
    CCMenuItemSprite* item3 = CCMenuItemSprite::create(spriteNormal, spriteSelected, spriteDisabled, this, menu_selector(MenuLayer3::menuCallback3));
    m_disabledItem = item3;  item3->retain();
    m_disabledItem->setEnabled( false );
    
    CCMenu *menu = CCMenu::create( item1, item2, item3, NULL);    
    menu->setPosition( CCPointMake(0,0) );

    CCSize s = CCDirector::sharedDirector()->getWinSize();
    
    item1->setPosition( CCPointMake(s.width/2 - 150, s.height/2) );
    item2->setPosition( CCPointMake(s.width/2 - 200, s.height/2) );
    item3->setPosition( CCPointMake(s.width/2, s.height/2 - 100) );
    
    CCJumpBy* jump = CCJumpBy::create(3, CCPointMake(400,0), 50, 4);
    item2->runAction( CCRepeatForever::create(
                                (CCActionInterval*)(CCSequence::create( jump, jump->reverse(), NULL))
                                )
                    );
    CCActionInterval* spin1 = CCRotateBy::create(3, 360);
    CCActionInterval* spin2 = (CCActionInterval*)(spin1->copy()->autorelease());
    CCActionInterval* spin3 = (CCActionInterval*)(spin1->copy()->autorelease());
    
    item1->runAction( CCRepeatForever::create(spin1) );
    item2->runAction( CCRepeatForever::create(spin2) );
    item3->runAction( CCRepeatForever::create(spin3) );
    
    addChild( menu ); 

    menu->setPosition(ccp(0,0));
}
开发者ID:DangoXJ,项目名称:TuJinZhi,代码行数:49,代码来源:MenuTest.cpp


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