本文整理汇总了C++中Tile::GetValueByType方法的典型用法代码示例。如果您正苦于以下问题:C++ Tile::GetValueByType方法的具体用法?C++ Tile::GetValueByType怎么用?C++ Tile::GetValueByType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tile
的用法示例。
在下文中一共展示了Tile::GetValueByType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void TextInputJournal::Init()
{
//TODO: Turn creation of menus into a template function?
InterfaceManager* intfc = InterfaceManager::GetSingleton();
// Is BookMenu already open?
BookMenu* bookMenu = (BookMenu*)GetMenuByType(kMenuType_Book);
if (bookMenu) // open, so get rid of it first
bookMenu->Destructor(1);
// create new book menu
Tile* tile = intfc->menuRoot->ReadXML("data\\menus\\book_menu.xml");
if (tile)
{
Tile* bookRoot = tile->GetRoot();
if (bookRoot)
{
TileMenu* bookMenuTile = tile_cast <TileMenu>(bookRoot);
if (bookMenuTile)
{
BookMenu* bookMenu = (BookMenu*)(bookMenuTile->menu);
if (bookMenu)
{
bookMenu->book = m_dummyBook;
bookMenu->bookRef = NULL;
ToggleMenuShortcutKeys(false, bookMenu);
bookMenu->RegisterTile(bookMenuTile);
// update depth
Tile* backgroundTile = NULL;
if (m_dummyBook->IsScroll())
backgroundTile = bookMenu->tile->GetChildByName("book_background_scroll");
else
backgroundTile = bookMenu->tile->GetChildByName("book_background");
Tile::Value* depthVal = backgroundTile->GetValueByType(kTileValue_depth);
if (depthVal)
{
backgroundTile->UpdateFloat(kTileValue_depth, depthVal->num + intfc->GetDepth());
depthVal->num += intfc->GetDepth();
}
if (!m_dummyBook->IsScroll())
bookMenu->tile->UpdateFloat(BookMenu::kBookValue_IsBook, 2.0);
bookMenu->EnableMenu(false);
bookMenu->UpdateText(m_inputText.c_str());
}
}
}
}
}
示例2:
Tile::Value * Tile::GetValueByName(char* name)
{
char* strtokContext = NULL;
char * childName = strtok_s(name, "\\/", &strtokContext);
char* nextName = NULL;
Tile * parentTile = this;
while (childName && parentTile)
{
nextName = strtok_s(NULL, "\\/", &strtokContext);
if (!nextName)
break;
parentTile = parentTile->GetChildByName(childName);
childName = nextName;
}
if (childName && !nextName && parentTile) // childName is now name of value to retrieve
return parentTile->GetValueByType(StrToStrID(childName));
return NULL;
}