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


C++ Member::autorelease方法代码示例

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


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

示例1: init

bool JoinMembers::init()
{
	CCLayer::init();
		
	this->setTouchEnabled(true);
	schedule(schedule_selector(JoinMembers::update));
	goalPoint = ccp(240, 160);
	
	Member* findingUser = new Member();
	findingUser->initWithFile("search_finding.png");
	findingUser->autorelease();
	findingUser->setPosition(ccp(240, 225 + 20.f));
	findingUser->goalPoint = findingUser->getPosition();
	findingUser->startPoint = findingUser->getPosition();
	findingUser->runAction(CCRepeatForever::create(CCSequence::createWithTwoActions(CCFadeOut::create(1.f),
																					  CCFadeIn
																					  ::create(1.f))));
//	findingUser->isGoal = true;
	addChild(findingUser);
	members.push_back(findingUser);
	
	allUser = new Member();
	allUser->initWithFile("search_user.png");
	allUser->setPosition(ccp(240, 176  + 20.f));
	allUser->goalPoint = allUser->getPosition();
	allUser->startPoint = allUser->getPosition();
	addChild(allUser);
//	allUser->isGoal = true;
	members.push_back(allUser);
	
	Member* me = new Member();
	me->initWithFile("search_me.png");
	
	me->autorelease();
//	me->setScale(2.f);
//	me->isGoal = true;
	me->setPosition(ccp(240, 145  + 20.f));
	me->goalPoint = me->getPosition();
	me->startPoint = me->getPosition();
	addChild(me);
	members.push_back(me);
	
	CCSprite* flag = CCSprite::createWithSpriteFrameName((NSDefault::getCountry() + ".png").c_str());
	flag->setPosition(ccp(28, 22));
	me->addChild(flag);
	
	CCLabelTTF* userName = CCLabelTTF::create(NSDefault::getUserName().c_str(), defaultFont, 13.f);
	userName->setColor(ccc3(0,0,0));
	me->addChild(userName);
	userName->setAnchorPoint(ccp(0.f, 0.5f));
	userName->setPosition(ccp(55, 21));
	
	Member* progressBack = new Member();
	progressBack->initWithFile("search_back.png");
	progressBack->autorelease();
	progressBack->setPosition(ccp(240, 202  + 20.f));
	progressBack->startPoint = progressBack->goalPoint = progressBack->getPosition();
	addChild(progressBack);
	
	members.push_back(progressBack);
	
	progress = CCProgressTimer::create(CCSprite::create("search_front.png"));
	progress->setBarChangeRate(ccp(1, 0));
	progress->setMidpoint(ccp(0, 0.5f));
	progress->setType(CCProgressTimerType::kCCProgressTimerTypeBar);
	progress->setPosition(ccp(240, 202  + 20.f));
	progress->setPercentage(0.f);
	addChild(progress);
	
	return true;
}
开发者ID:LitQoo,项目名称:SportsWorldCupOriginal,代码行数:71,代码来源:JoinMembers.cpp


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