本文整理汇总了C++中cegui::FrameWindow::getPosition方法的典型用法代码示例。如果您正苦于以下问题:C++ FrameWindow::getPosition方法的具体用法?C++ FrameWindow::getPosition怎么用?C++ FrameWindow::getPosition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::FrameWindow
的用法示例。
在下文中一共展示了FrameWindow::getPosition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveGUISizes
/***********************************************************
save size of windows to be restored after resize of the application
***********************************************************/
void JournalBox::SaveGUISizes(int oldscreenX, int oldscreenY)
{
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("JournalFrame"));
CEGUI::UVector2 vec = frw->getPosition();
_savedPosX = vec.d_x.asRelative((float)oldscreenX);
_savedPosY = vec.d_y.asRelative((float)oldscreenY);
_savedSizeX = frw->getWidth().asRelative((float)oldscreenX);
_savedSizeY = frw->getHeight().asRelative((float)oldscreenY);
}
示例2:
/***********************************************************
destructor
***********************************************************/
LetterViewerBox::~LetterViewerBox()
{
{
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("LetterViewerWIndowFrame"));
CEGUI::UVector2 vec = frw->getPosition();
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.PosX", vec.d_x.d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.PosY", vec.d_y.d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.SizeX", frw->getWidth().d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.SizeY", frw->getHeight().d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.OffsetPosX", vec.d_x.d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.OffsetPosY", vec.d_y.d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.OffsetSizeX", frw->getWidth().d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.LetterViewerFrame.OffsetSizeY", frw->getHeight().d_offset);
}
}
示例3:
/***********************************************************
destructor
***********************************************************/
CommunityBox::~CommunityBox()
{
try
{
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("CommunityFrame"));
CEGUI::UVector2 vec = frw->getPosition();
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.PosX", vec.d_x.d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.PosY", vec.d_y.d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.SizeX", frw->getWidth().d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.SizeY", frw->getHeight().d_scale);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.OffsetPosX", vec.d_x.d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.OffsetPosY", vec.d_y.d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.OffsetSizeX", frw->getWidth().d_offset);
ConfigurationManager::GetInstance()->SetFloat("Gui.Communitybox.OffsetSizeY", frw->getHeight().d_offset);
ConfigurationManager::GetInstance()->SetBool("Gui.Communitybox.Visible", frw->isVisible());
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception destructor community box: ") + ex.getMessage().c_str());
}
}
示例4:
/***********************************************************
destructor
***********************************************************/
JournalBox::~JournalBox()
{
try
{
CEGUI::FrameWindow * frw = static_cast<CEGUI::FrameWindow *> (
CEGUI::WindowManager::getSingleton().getWindow("JournalFrame"));
int resX, resY;
bool fullscreen;
OsgHandler::getInstance()->GetScreenAttributes(resX, resY, fullscreen);
CEGUI::UVector2 vec = frw->getPosition();
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.PosX", vec.d_x.asRelative((float)resX));
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.PosY", vec.d_y.asRelative((float)resY));
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.SizeX", frw->getWidth().asRelative((float)resX));
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.SizeY", frw->getHeight().asRelative((float)resY));
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.Visible", frw->isVisible());
{
std::string qtreedown;
std::string selected;
std::map<std::string, CEGUI::TreeItem *>::iterator itm = _mapquestarea.begin();
std::map<std::string, CEGUI::TreeItem *>::iterator endm = _mapquestarea.end();
for(; itm != endm; ++itm)
{
if(itm->second->getIsOpen())
{
qtreedown += "##" + itm->first;
}
std::vector<CEGUI::TreeItem*> items = itm->second->getItemList();
for(size_t i=0; i<items.size(); ++i)
{
if(items[i]->isSelected())
selected = items[i]->getText().c_str();
}
}
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.QuestTreeOpen", qtreedown);
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.QuestTreeSelected", selected);
}
{
std::string qtreedown;
std::string selected;
std::map<std::string, CEGUI::TreeItem *>::iterator itm = _mapquestdonearea.begin();
std::map<std::string, CEGUI::TreeItem *>::iterator endm = _mapquestdonearea.end();
for(; itm != endm; ++itm)
{
if(itm->second->getIsOpen())
{
qtreedown += "##" + itm->first;
}
std::vector<CEGUI::TreeItem*> items = itm->second->getItemList();
for(size_t i=0; i<items.size(); ++i)
{
if(items[i]->isSelected())
selected = items[i]->getText().c_str();
}
}
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.QuestDoneTreeOpen", qtreedown);
ConfigurationManager::GetInstance()->SetValue("Gui.JournalBox.QuestDoneTreeSelected", selected);
}
}
catch(CEGUI::Exception &ex)
{
LogHandler::getInstance()->LogToFile(std::string("Exception destructor Inventorybox: ") + ex.getMessage().c_str());
}
}