本文整理汇总了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;
}
}