本文整理汇总了C++中THMap::setPlayerCameraTile方法的典型用法代码示例。如果您正苦于以下问题:C++ THMap::setPlayerCameraTile方法的具体用法?C++ THMap::setPlayerCameraTile怎么用?C++ THMap::setPlayerCameraTile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类THMap
的用法示例。
在下文中一共展示了THMap::setPlayerCameraTile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _onSaveMenuSave
void frmMain::_onSaveMenuSave(wxCommandEvent& evt)
{
if(m_sFilename.empty())
{
_onSaveMenuSaveAs(evt);
return;
}
map_save_t oSave;
if(oSave.fFile.Open(m_sFilename, wxFile::write))
{
lua_State* L = m_pGamePanel->getLua();
luaT_execute(L, "return TheApp.world.map.th");
THMap *pMap = reinterpret_cast<THMap*>(lua_touserdata(L, -1));
lua_pop(L, 1);
THMapWrapper::autoSetHelipad(pMap);
luaT_execute(L, "return TheApp.ui:ScreenToWorld(...)",
m_pGamePanel->GetSize().GetWidth() / 2,
m_pGamePanel->GetSize().GetHeight() / 2);
int iCameraX = (int)lua_tointeger(L, -2);
int iCameraY = (int)lua_tointeger(L, -1);
lua_pop(L, 2);
pMap->setPlayerCameraTile(0, iCameraX, iCameraY);
pMap->save(map_save_t::writer, reinterpret_cast<void*>(&oSave));
::wxMessageBox(wxT("Map saved."), wxT("Save"), wxOK | wxCENTER |
wxICON_INFORMATION, this);
}
}
示例2: l_map_set_player_camera
static int l_map_set_player_camera(lua_State *L)
{
THMap* pMap = luaT_testuserdata<THMap>(L);
int iX = static_cast<int>(luaL_checkinteger(L, 2) - 1);
int iY = static_cast<int>(luaL_checkinteger(L, 3) - 1);
int iPlayer = static_cast<int>(luaL_optinteger(L, 4, 1));
if (iPlayer < 1 || iPlayer > player_max)
return luaL_error(L, "Player index out of range: %i", iPlayer);
pMap->setPlayerCameraTile(iPlayer - 1, iX, iY);
return 0;
}