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


C++ BaseSprite::getPositionY方法代码示例

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


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

示例1: tableCellAtIndex

CCTableViewCell* TanSuoLayer::tableCellAtIndex(CCTableView *table, unsigned int idx)
{
	CCTableViewCell *cell = table->dequeueCell();
	if (cell != NULL)
	{
		cell->removeAllChildren();
	}
	else 
	{
		cell = new CCTableViewCell();
		cell->autorelease();
	}

	if (table->getParent() != NULL)
	{
		CCSize cellSize = tableCellSizeForIndex(table, idx);
		Profession profId = mHeros.at(idx)->getCurrentProperty().profession;

		//head  Profession 1-10
		BaseSprite *headImg = BaseSprite::create(ImageManager::getManager()->getImageData_ProfessionHead(profId).getCurrentImageFile());
		cell->addChild(headImg);
		headImg->setPosition(ccp(cellSize.width/2, 92));

		//menu
		FXScrollMenu *menu = FXScrollMenu::create(
			table->getParent()->convertToWorldSpace(table->getPosition()), table->getViewSize());
		cell->addChild(menu, 1);
		menu->setPosition(ccp(0,0));
		CCMenuItemImage *item = CCMenuItemImage::create(
			"renxing_renwu_touxiang.png",
			"renxing_renwu_touxiang_select.png", 
			"renxing_renwu_touxiang_select.png", 
			this, menu_selector(TanSuoLayer::menuItemClicked_JieFenHeroSelect));
		menu->addChild(item, 0, profId);

		m_lMenuItemList.push_back(item);

		item->setPosition(headImg->getPosition());
		//name
		CCLabelTTF *nameLabel = CCLabelTTF::create(BaseActorPropertyParser::getParser()->getExtraProerty(profId).nameInChinese.c_str()
			, fontStr_kaiti, m_nFontSize);
		cell->addChild(nameLabel);
		nameLabel->setPosition(ccp(headImg->getPositionX()
			, headImg->getPositionY()-headImg->getContentSize().height/2-nameLabel->getContentSize().height/2));
		nameLabel->setColor(ccc3(195, 145, 96));
	}

	return cell;
}
开发者ID:longguai,项目名称:game-DarkWar,代码行数:49,代码来源:TanSuoLayer.cpp

示例2: getSpriteOfZhuangbei

BaseSprite* ImageManager::getSpriteOfZhuangbei(string equipKeyWords,ZhuangbeiColourExt color,unsigned holdNum,vector<ItemsType> diamonds,QianghuaData qinghua,unsigned int jingLianTime /* = 0 */)
{
	std::string pic_file = "minute_" + equipKeyWords + ".png";

	BaseSprite* sprite = BaseSprite::create(pic_file);

	BaseSprite* hole1 = BaseSprite::create();
	BaseSprite* hole2 = BaseSprite::create();
	BaseSprite* hole3 = BaseSprite::create();

	// 精炼
	{
		if (jingLianTime > 0)
		{
			//BaseSprite* icon = BaseSprite::create("gongjiang_jinglian_tubiao.png");
			BaseSprite* icon = BaseSprite::create();
			icon->setContentSize(CCSizeMake(20,50));
			char temp[16];
			sprintf(temp,"+%u",jingLianTime);
			CCLabelTTF* lableNum = CCLabelTTF::create(temp,fontStr_BookAntiqua,40,CCSizeMake(0,0),kCCTextAlignmentRight);
			lableNum->setAnchorPoint(ccp(1.0f,0.5f));

			//{
			//	ccColor3B lableColor;
			//	switch (color)
			//	{
			//	case ImageManager::ZhuangbeiColourExt_Baizhuang:
			//		//lableColor = get
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_Fumo:
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_Xiyou:
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_Chuanqi:
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_ChuanQiTaoZhuang:
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_ShengBing:
			//		break;
			//	case ImageManager::ZhuangbeiColourExt_ShengBingTaoZhuang:
			//		break;
			//	default:
			//		break;
			//	}
			//	lableNum->setColor(lableColor);
			//}

			
			sprite->addChild(lableNum);
			sprite->addChild(icon);
			icon->setPositionY(sprite->getContentSize().height - icon->getContentSize().height/2);
			lableNum->setPosition(ccp(sprite->getContentSize().width - lableNum->getContentSize().width/2,icon->getPositionY()));
			icon->setPositionX(lableNum->getPositionX() - lableNum->getContentSize().width/2 - icon->getContentSize().width/2);
		}
	}

	// 强化
	{

		//sort
		for(int i=0; i<qinghua.qianghua_count; ++i)
		{
			for(int j=i; j<qinghua.qianghua_count; ++j)
			{
				if(  (qinghua.info_arr[i].level < qinghua.info_arr[j].level)   
					|| (qinghua.info_arr[i].level == qinghua.info_arr[j].level && 
					qinghua.info_arr[i].percent < qinghua.info_arr[j].percent)  )
				{
					swap(qinghua.info_arr[i], qinghua.info_arr[j]);
				}
			}
		}

		//float scale = 0.32f/(124/297.0f);
		float scale = 0.3f/(124/297.0f);
		BaseSprite* temp = BaseSprite::create("gongjiang_qianghua_jieguo_jin.png");
		float posX = temp->getContentSize().width/2 * scale;
		float posY = temp->getContentSize().height/2;

		for (int i=0;i<qinghua.max_qianghua_time;i++)
		{
			BaseSprite* imageStar = NULL;
			if (i < qinghua.qianghua_count)
			{
				switch (qinghua.info_arr[i].level)
				{
				case 4:
				case QianghuaLevel_jin_special:
					imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_jin.png");
					break;
				case 3:
					imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_yin.png");
					break;
				case 2:
					imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_tong.png");
					break;
				case 1:
					imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_tie.png");
					break;
				default:
//.........这里部分代码省略.........
开发者ID:longguai,项目名称:game-DarkWar,代码行数:101,代码来源:ImageManager.cpp

示例3: displayXiangQing

void MailInfoListLayer::displayXiangQing(Flat_DuanzaoGroupZBInfo zbInfo)
{
	//this->disableAllTouchBegin();
	mCurTaoZhuang_Info = zbInfo;

	

	BaseSprite *board = BaseSprite::create("zhuangbei_xiangxi_mianban.png");
	
	/*BaseLayer *layer = new BaseLayer();
	layer->setContentSize(board->getContentSize());
	layer->setPosition(board->getPosition());
	layer->addChild(board);*/
	CCDirector::sharedDirector()->getRunningScene()->addChild(board,1030);

	//MainLayerBase::getCurrentMainBase()->getHeader()->setContent(BaseSprite::create());
	//MainLayerBase::getCurrentMainBase()->setContaintLayer(layer,false);
	//layer->release();
	refreshEquipBoard(board, zbInfo);
	board->setPosition(ccp(CCDirector::sharedDirector()->getWinSize().width/2, CCDirector::sharedDirector()->getWinSize().height/2 + 106));

	ListMenu *menu = ListMenu::create();
	board->addChild(menu, 10);
	menu->setPosition(CCPointZero);
	//	menu->setTouchPriority(-131);
	BaseSprite *norImg = BaseSprite::create("close.png");
	BaseSprite *selImg = BaseSprite::create("close_select.png");
	CCMenuItemSprite *item = CCMenuItemSprite::create(norImg, selImg, NULL, this, menu_selector(MailInfoListLayer::menuItemClicked_close));
	menu->addChild(item, 0);
	item->setPosition(ccp(board->getContentSize().width-44+12, board->getContentSize().height-36+2));
	//底纹
	ImageData diWenData = ImageManager::getManager()->getImageData_DiWen_XiangQing(
		zbInfo.zhuangbei_colour
		, false
		, SuitPool::getPool()->isSuit(zbInfo.zb_group_id));
	BaseSprite* diWen = BaseSprite::create(diWenData.getCurrentImageFile());
	diWen->setScale(0.7f);
	board->addChild(diWen);
	diWen->setPosition(ccp(123, 838-240+122));
	// 装备图片
	string equipfile = zbInfo.zhuangbei_pic;
	equipfile = "minute_" + equipfile + ".png";
	BaseSprite *s = BaseSprite::create(equipfile);
	diWen->addChild(s);
	s->setPosition(ccp(diWen->getContentSize().width/2,diWen->getContentSize().height/2));
	//套装按钮
	if(SuitPool::getPool()->isSuit(zbInfo.zb_group_id))
	{
		string norStr = "zhuangbei_xiangxi_mianban_anniu_taozhuang.png";
		string selStr = "zhuangbei_xiangxi_mianban_anniu_taozhuang_select.png";
		// 		if (ChuanqiPool::getPool()->isShenBing(mEquipVec.at(idx).zb_group_id))
		// 		{
		// 			norStr = "zhuangbei_xiangxi_mianban_anniu_taozhuang_shenbing.png";
		// 			selStr = "zhuangbei_xiangxi_mianban_anniu_taozhuang_shenbing_select.png";
		// 		}  
		CCMenuItemImage *taozhuangItem = CCMenuItemImage::create(
			norStr.c_str()
			, selStr.c_str()
			, this ,menu_selector(MailInfoListLayer::menuItemClicked_equipDetailMenu));
		menu->addChild(taozhuangItem, 0);
		taozhuangItem->setAnchorPoint(ccp(1, 0));
		taozhuangItem->setPosition(ccp(diWen->getPositionX()+diWen->getContentSize().width/2*diWen->getScaleX()
			, diWen->getPositionY()-diWen->getContentSize().height/2*diWen->getScaleY()));
		taozhuangItem->setEnabled(false);
	}
	m_dEquimentDialog = board;
	m_mDEquipmentMenu = menu;
}
开发者ID:longguai,项目名称:game-DarkWar,代码行数:68,代码来源:MailInfoListLayer.cpp


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