{
text_.clear();
string scoreStr;
if ( numParam > 0 )
{
scoreStr = ToString( numParam );
}
text_ += preStr;
text_ += strParam;
text_ += midStr;
text_ += scoreStr;
text_ += endStr;
textSize = font->GetTextSize( CharToWchar(text_.c_str()) );
dstPos.x = -(float)textSize.cx;
dstPos.y = srcPos.y;
fontPos = srcPos;
bShow = true;
bEnd = false;
}
void GlobalTipManager::ShowTip( GLOBAL_TIP_TYPE type, const char* strParam, int numParam )
{
srcPos.x = SCREEN_WIDTH;
srcPos.y = 250.0f + 50.0f*ActiveTipList.size();
GlobalTip *tempTip = NULL;
switch( type )
{
case G_TIP_HIGHSCORE:
{
tempTip = pGlobalHighScoreTip[nHighScoreTipIndex];
if ( tempTip )
{
tempTip->SetSrcPos( srcPos );
tempTip->ShowTip( type, strParam, numParam );
ActiveTipList.push_back( tempTip );
nHighScoreTipIndex ++;
if ( nHighScoreTipIndex >= GLOBAL_TIP_MAX_SIZE )
{
nHighScoreTipIndex = 0;
}
}
}
break;
case G_TIP_DEFENDSEVER:
{
tempTip = pGlobalDefendSeverTip[nDefendSeverTipIndex];
if ( tempTip )
{
tempTip->SetSrcPos( srcPos );
tempTip->ShowTip( type, strParam, numParam );
ActiveTipList.push_back( tempTip );
nDefendSeverTipIndex ++;
if ( nDefendSeverTipIndex >= GLOBAL_TIP_MAX_SIZE )
{
nDefendSeverTipIndex = 0;
}
}
}
break;
case G_TIP_OTHER:
GAME_LOG_EX("Other Type...");
break;
default:
GAME_LOG_EX("type 异常 type = %d", (int)type);
break;
}
//
}