本文整理汇总了C++中GraphicsObject::setTemporary方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsObject::setTemporary方法的具体用法?C++ GraphicsObject::setTemporary怎么用?C++ GraphicsObject::setTemporary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsObject
的用法示例。
在下文中一共展示了GraphicsObject::setTemporary方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateGui
//---------------------------------------------------------------------------------
// Name: updateGui()
//---------------------------------------------------------------------------------
void GameplayState::updateGui()
{
unsigned data[4] = {0};
data[0] = BATTLE_CITY->getEnemiesLeft();
data[1] = BATTLE_CITY->getPlayerLivesNum( PLAYER_ONE_TANK );
data[2] = BATTLE_CITY->getPlayerLivesNum( PLAYER_TWO_TANK );
data[3] = BATTLE_CITY->getCurrMapNumber();
if ( (data[0] ^ m_tdata[0]) | (data[1] ^ m_tdata[1]) | (data[2] ^ m_tdata[2] ) )
{
char buff[100] = {0};
sprintf( buff,
"T : %.2d | 1P : %.2d | 2P : %.2d | M : %.2d",
data[0],
data[1],
data[2],
data[3] );
if ( BATTLE_CITY->getGameMode() == _1PLAYER_MODE )
memset( buff + 19, ' ', sizeof(char) << 3 );
int buff_w, buff_h;
RENDER_MGR->getFontManager()->getStringSize(buff, &buff_w, &buff_h, m_font_id );
if ( !m_data_gui_go.expired() )
{
GraphicsObject * obj = m_data_gui_go._Get();
obj->setTemporary(true);
}
m_data_gui_go = GUI_TEXT( buff, ( BASE_SCREEN_WIDTH - buff_w ) >> 1, buff_h, CYAN_COLOR );
memcpy( m_tdata, data, sizeof(unsigned) << 2 );
}