void MySevenSegment::Effect( byte mode, unsigned long Value ) { switch( mode ) { case LED_NUM: //若數字相同則不做任何反應;// if( mCurrentNum == Value ) return; //新數字比舊數字小,直接更改數字不顯示效果;// if( mCurrentNum > Value ) { mCurrentNum = Value; PrintNumber( mCurrentNum, false ); return; } //單位數滾動;// EffectPlusOne( Value ); //閃動2次;// EffectFlicker(2); break; case LED_SERVER: //EffectServer(); //EffectAround(1); EffectAroundStep(); break; } }
void CUITextBanner::Out(float x, float y, const char *fmt, ...) { if (!fmt) return; StyleParams_it it = m_StyleParams.begin(); // Применяем эффекты for (; it != m_StyleParams.end(); ++it) { // Fade effect if (it->first & tbsFade) { EffectFade(); } // Flicker effect if (it->first & tbsFlicker) { EffectFlicker(); } } va_list Print; string512 msg; xr_string buf; va_start(Print, fmt); vsprintf_s( msg , fmt , Print ); va_end(Print); buf += msg; R_ASSERT(m_pFont); m_pFont->SetColor(m_Cl); m_pFont->SetAligment(aligment); // if(fontSize>0.0f) // m_pFont->SetHeight(fontSize); Fvector2 pos; UI()->ClientToScreenScaled(pos, x, y); m_pFont->Out(pos.x, pos.y, "%s", buf.c_str()); }