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


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

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


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

示例1: getSpriteOfZhuangbei


//.........这里部分代码省略.........
			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:
					CCLog("Error : %s --> qiangjhua_level = %d",__FUNCTION__,qinghua.info_arr[i].level);
					imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_tie.png");
					CCAssert(false,"未知的level");
				}
			}
			else
			{
				imageStar = BaseSprite::create("gongjiang_qianghua_jieguo_kong.png");
			}


			sprite->addChild(imageStar);
			imageStar->setPosition(ccp(posX,posY));
			imageStar->setScale(scale);
			posX += temp->getContentSize().width * imageStar->getScaleX() - 8;
		}
	}

	if(holdNum == 1)
	{
		hole1 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole1);
		hole1->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height/2));
	}
	else if(holdNum == 2)
	{
		hole1 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole1);
		hole1->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height*3.3f/5));

		hole2 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole2);
		hole2->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height*1.7f/5));
	}
	else if(holdNum == 3)
	{
		hole1 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole1);
		hole1->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height*3.5f/5));

		hole2 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole2);
		hole2->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height* 1.0f/2.0f));

		hole3 = BaseSprite::create("zhuangbei_kong.png");
		sprite->addChild(hole3);
		hole3->setPosition(ccp(sprite->getContentSize().width/2, sprite->getContentSize().height*1.5f/5));
开发者ID:longguai,项目名称:game-DarkWar,代码行数:67,代码来源:ImageManager.cpp

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