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


C++ Window::setUserString方法代码示例

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


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

示例1: DoDraw


//.........这里部分代码省略.........
		
		res->setText(unitItr->name);
		
		j=0;
		name="";
		
		for(charItr=unitItr->character.begin();charItr!= unitItr->character.end();++charItr){
			if(charItr->first=="Manpower"){
				text="\n HP:"+Logic::LogicStd::IntToString(charItr->second);
			}
			name +=charItr->first+" : "+Logic::LogicStd::IntToString(charItr->second)+"\n";
		}
		res->setText(unitItr->name+text);
		res->setTooltipText(name);
		i++;
	}
	i=0;
	for(unitItr=evnt->NPCUnit.begin();unitItr!= evnt->NPCUnit.end();++unitItr){
		name="BattlifieldSheet/npcunitName"+Logic::LogicStd::IntToString(i);
		if(wmgr.isWindowPresent(name)){
			res= wmgr.getWindow(name);
			if(!evnt->isReSend){
				mFrameWindow->addChildWindow(res);
			}
		}else{
			res= wmgr.createWindow("TaharezLook/StaticText", name);
			res->setPosition(CEGUI::UVector2(CEGUI::UDim(0.1*i,0), CEGUI::UDim(0.65, 0)));
			res->setSize(CEGUI::UVector2(CEGUI::UDim(0.1, 0), CEGUI::UDim(0.3, 0)));

			mFrameWindow->addChildWindow(res);
		}
		
	
		
		
		name="";
		
		for(charItr=unitItr->character.begin();charItr!= unitItr->character.end();++charItr){
			if(charItr->first=="Manpower"){
				text="\n HP:"+Logic::LogicStd::IntToString(charItr->second);
			}
			name +=charItr->first+" : "+Logic::LogicStd::IntToString(charItr->second)+"\n";
		}
		res->setText(unitItr->name+text);
		res->setTooltipText(name);
		i++;
	}

	for(i=0;i<4;i++){
		name = "BattlifieldSheet/action"+Logic::LogicStd::IntToString(i);
		if(!wmgr.isWindowPresent(name)){

			res= wmgr.createWindow("TaharezLook/Button",name );
			res->setPosition(CEGUI::UVector2(CEGUI::UDim(1-0.15*(i+1),0), CEGUI::UDim(0, 0)));
			res->setSize(CEGUI::UVector2(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0)));
			
			res->subscribeEvent(CEGUI::PushButton::EventClicked,
				CEGUI::Event::Subscriber(&DrawWarfare::SetAction,this));
			res->setUserString("type" ,Logic::LogicStd::IntToString(i));
		}else{
			res= wmgr.getWindow(name);
			if(!evnt->isReSend){
				mFrameWindow->addChildWindow(res);
			}
		}
		name = "";
		
		if(evnt->curAction == (Logic::WarfareAction)i){
			name="[colour='FFFF0000']";
		}
		switch(i){
			case 0:
				res->setText(name+"Stand");	
				break;
			case 1:
				res->setText(name+"Occupied");	
				break;
			case 2:
				res->setText(name+"Pillage");	
				break;	
			case 3:
				res->setText(name+"Kill with Fire");	
				break;
			}
		if(!evnt->isReSend){
			mFrameWindow->addChildWindow(res);
		}
	} 
	switch(evnt->status){
	case  Logic::WARSTS_AFTERMATCH:

		break;
	}
	if(!evnt->isReSend){
	mMainWindow->addChildWindow(mFrameWindow);
	PriorIdDraw= true;
	}else{
	PriorIdDraw= false;
	}
}
开发者ID:JazzyJohn,项目名称:ProtoSpaceGame,代码行数:101,代码来源:DrawWarfare.cpp


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