Added disableShadow method to ScalableFont, and

added black shadow/outline to text in the race gui.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8107 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-03-29 22:59:32 +00:00
parent ca651b37b3
commit d00f587d7a
3 changed files with 7 additions and 3 deletions

View File

@ -77,7 +77,7 @@ void ScalableFont::updateRTL()
m_rtl = translations->isRTLLanguage();
}
void ScalableFont::setShadow(irr::video::SColor col)
void ScalableFont::setShadow(const irr::video::SColor &col)
{
m_shadow = true;
m_shadow_color = col;

View File

@ -121,7 +121,8 @@ public:
/** Sets if digits are to be mono-spaced. */
void setMonospaceDigits(bool mono) {m_mono_space_digits = mono; }
bool getMonospaceDigits() const { return m_mono_space_digits; }
void setShadow(irr::video::SColor col);
void setShadow(const irr::video::SColor &col);
void disableShadow() {m_shadow = false;}
//! gets the sprite bank
virtual IGUISpriteBank* getSpriteBank() const;

View File

@ -580,6 +580,9 @@ void MinimalRaceGUI::drawRankLap(const KartIconDisplayInfo* info,
: GUIEngine::getFont());
float scale = font->getScale();
font->setScale(m_font_scale);
// Add a black shadow to make the text better readable on
// 'white' tracks (e.g. with snow and ice).
font->setShadow(video::SColor(255, 0, 0, 0));
static video::SColor color = video::SColor(255, 255, 255, 255);
WorldWithRank *world = (WorldWithRank*)(World::getWorld());
@ -637,7 +640,7 @@ void MinimalRaceGUI::drawRankLap(const KartIconDisplayInfo* info,
}
}
font->setScale(scale);
font->disableShadow();
} // drawRankLap
//-----------------------------------------------------------------------------