Color the text (mainly border including title and billboard) base on current skin
This commit is contained in:
parent
bc712b5a44
commit
962fe919d2
@ -257,4 +257,9 @@ when the border that intersect at this corner are enabled.
|
|||||||
<!-- Rating star image -->
|
<!-- Rating star image -->
|
||||||
<element type="rating" state="neutral" image="ocean/rating_star.png" />
|
<element type="rating" state="neutral" image="ocean/rating_star.png" />
|
||||||
|
|
||||||
|
<!-- Font color -->
|
||||||
|
<color type="top" state="font" a="255" r="100" g="200" b="220" />
|
||||||
|
<color type="bottom" state="font" a="255" r="80" g="80" b="220" />
|
||||||
|
<color type="normal" state="font" a="255" r="40" g="40" b="180" />
|
||||||
|
|
||||||
</skin>
|
</skin>
|
||||||
|
@ -255,4 +255,9 @@ when the border that intersect at this corner are enabled.
|
|||||||
<!-- Rating star image -->
|
<!-- Rating star image -->
|
||||||
<element type="rating" state="neutral" image="peach/rating_star.png" />
|
<element type="rating" state="neutral" image="peach/rating_star.png" />
|
||||||
|
|
||||||
|
<!-- Font color -->
|
||||||
|
<color type="top" state="font" a="255" r="255" g="128" b="0" />
|
||||||
|
<color type="bottom" state="font" a="255" r="255" g="220" b="15" />
|
||||||
|
<color type="normal" state="font" a="255" r="210" g="100" b="50" />
|
||||||
|
|
||||||
</skin>
|
</skin>
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
// along with this program; if not, write to the Free Software
|
// along with this program; if not, write to the Free Software
|
||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "guiengine/scalable_font.hpp"
|
|
||||||
|
|
||||||
#include "graphics/2dutils.hpp"
|
#include "graphics/2dutils.hpp"
|
||||||
#include "guiengine/engine.hpp"
|
#include "guiengine/engine.hpp"
|
||||||
|
#include "guiengine/scalable_font.hpp"
|
||||||
|
#include "guiengine/skin.hpp"
|
||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "utils/translation.hpp"
|
#include "utils/translation.hpp"
|
||||||
|
|
||||||
@ -992,10 +992,11 @@ void ScalableFont::doDraw(const core::stringw& text,
|
|||||||
|
|
||||||
if (fallback[n] || m_type == T_BOLD)
|
if (fallback[n] || m_type == T_BOLD)
|
||||||
{
|
{
|
||||||
// TODO: don't hardcode colors?
|
video::SColor title_colors[] = {GUIEngine::getSkin()->getColor("top::font" ),
|
||||||
video::SColor orange(color.getAlpha(), 255, 100, 0);
|
GUIEngine::getSkin()->getColor("bottom::font"),
|
||||||
video::SColor yellow(color.getAlpha(), 255, 220, 15);
|
GUIEngine::getSkin()->getColor("top::font" ),
|
||||||
video::SColor title_colors[] = {orange, yellow, orange, yellow};
|
GUIEngine::getSkin()->getColor("bottom::font")
|
||||||
|
};
|
||||||
|
|
||||||
if (charCollector != NULL)
|
if (charCollector != NULL)
|
||||||
{
|
{
|
||||||
|
@ -354,9 +354,9 @@ void PlayerController::update(float dt)
|
|||||||
if (m)
|
if (m)
|
||||||
{
|
{
|
||||||
m->addMessage(_("Penalty time!!"), m_kart, 2.0f,
|
m->addMessage(_("Penalty time!!"), m_kart, 2.0f,
|
||||||
video::SColor(255, 255, 128, 0));
|
GUIEngine::getSkin()->getColor("top::font"));
|
||||||
m->addMessage(_("Don't accelerate before go"), m_kart, 2.0f,
|
m->addMessage(_("Don't accelerate before go"), m_kart, 2.0f,
|
||||||
video::SColor(255, 210, 100, 50));
|
GUIEngine::getSkin()->getColor("normal::font"));
|
||||||
}
|
}
|
||||||
m_bzzt_sound->play();
|
m_bzzt_sound->play();
|
||||||
|
|
||||||
|
@ -2753,8 +2753,8 @@ void Kart::setOnScreenText(const wchar_t *text)
|
|||||||
gui::ScalableFont* font = GUIEngine::getFont() ? GUIEngine::getFont()
|
gui::ScalableFont* font = GUIEngine::getFont() ? GUIEngine::getFont()
|
||||||
: GUIEngine::getTitleFont();
|
: GUIEngine::getTitleFont();
|
||||||
new STKTextBillboard(text, font,
|
new STKTextBillboard(text, font,
|
||||||
video::SColor(255, 255, 225, 0),
|
GUIEngine::getSkin()->getColor("bottom::font"),
|
||||||
video::SColor(255, 255, 89, 0),
|
GUIEngine::getSkin()->getColor("top::font"),
|
||||||
getNode(), irr_driver->getSceneManager(), -1,
|
getNode(), irr_driver->getSceneManager(), -1,
|
||||||
core::vector3df(0.0f, 1.5f, 0.0f),
|
core::vector3df(0.0f, 1.5f, 0.0f),
|
||||||
core::vector3df(1.0f, 1.0f, 1.0f));
|
core::vector3df(1.0f, 1.0f, 1.0f));
|
||||||
@ -2770,8 +2770,8 @@ void Kart::setOnScreenText(const wchar_t *text)
|
|||||||
textsize.Height/55.0f),
|
textsize.Height/55.0f),
|
||||||
core::vector3df(0.0f, 1.5f, 0.0f),
|
core::vector3df(0.0f, 1.5f, 0.0f),
|
||||||
-1, // id
|
-1, // id
|
||||||
video::SColor(255, 255, 225, 0),
|
GUIEngine::getSkin()->getColor("bottom::font"),
|
||||||
video::SColor(255, 255, 89, 0));
|
GUIEngine::getSkin()->getColor("top::font"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// No need to store the reference to the billboard scene node:
|
// No need to store the reference to the billboard scene node:
|
||||||
|
@ -282,7 +282,7 @@ void LinearWorld::newLap(unsigned int kart_index)
|
|||||||
if (raceHasLaps() && kart_info.m_race_lap+1 == lap_count)
|
if (raceHasLaps() && kart_info.m_race_lap+1 == lap_count)
|
||||||
{
|
{
|
||||||
m_race_gui->addMessage(_("Final lap!"), kart,
|
m_race_gui->addMessage(_("Final lap!"), kart,
|
||||||
3.0f, video::SColor(255, 210, 100, 50), true);
|
3.0f, GUIEngine::getSkin()->getColor("normal::font"), true);
|
||||||
if(!m_last_lap_sfx_played && lap_count > 1)
|
if(!m_last_lap_sfx_played && lap_count > 1)
|
||||||
{
|
{
|
||||||
if (UserConfigParams::m_music)
|
if (UserConfigParams::m_music)
|
||||||
@ -309,7 +309,7 @@ void LinearWorld::newLap(unsigned int kart_index)
|
|||||||
kart_info.m_race_lap+1 < lap_count)
|
kart_info.m_race_lap+1 < lap_count)
|
||||||
{
|
{
|
||||||
m_race_gui->addMessage(_("Lap %i", kart_info.m_race_lap+1),
|
m_race_gui->addMessage(_("Lap %i", kart_info.m_race_lap+1),
|
||||||
kart, 3.0f, video::SColor(255, 210, 100, 50),
|
kart, 3.0f, GUIEngine::getSkin()->getColor("normal::font"),
|
||||||
true);
|
true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ namespace Scripting
|
|||||||
{
|
{
|
||||||
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
gui::ScalableFont* font = GUIEngine::getHighresDigitFont();
|
||||||
STKTextBillboard* tb = new STKTextBillboard(wtext.c_str(), font,
|
STKTextBillboard* tb = new STKTextBillboard(wtext.c_str(), font,
|
||||||
video::SColor(255, 255, 225, 0),
|
GUIEngine::getSkin()->getColor("bottom::font"),
|
||||||
video::SColor(255, 255, 89, 0),
|
GUIEngine::getSkin()->getColor("top::font"),
|
||||||
irr_driver->getSceneManager()->getRootSceneNode(),
|
irr_driver->getSceneManager()->getRootSceneNode(),
|
||||||
irr_driver->getSceneManager(), -1, xyz,
|
irr_driver->getSceneManager(), -1, xyz,
|
||||||
core::vector3df(1.5f, 1.5f, 1.5f));
|
core::vector3df(1.5f, 1.5f, 1.5f));
|
||||||
@ -117,8 +117,8 @@ namespace Scripting
|
|||||||
textsize.Height / 35.0f),
|
textsize.Height / 35.0f),
|
||||||
xyz,
|
xyz,
|
||||||
-1, // id
|
-1, // id
|
||||||
video::SColor(255, 255, 225, 0),
|
GUIEngine::getSkin()->getColor("bottom::font"),
|
||||||
video::SColor(255, 255, 89, 0));
|
GUIEngine::getSkin()->getColor("top::font"));
|
||||||
World::getWorld()->getTrack()->addNode(sn);
|
World::getWorld()->getTrack()->addNode(sn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -467,7 +467,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
|||||||
irr_driver->getActualScreenSize().Width,
|
irr_driver->getActualScreenSize().Width,
|
||||||
irr_driver->getActualScreenSize().Height);
|
irr_driver->getActualScreenSize().Height);
|
||||||
GUIEngine::getOutlineFont()->draw(_("Press fire to play the tutorial"), pos2,
|
GUIEngine::getOutlineFont()->draw(_("Press fire to play the tutorial"), pos2,
|
||||||
video::SColor(255,255,150,60),
|
GUIEngine::getSkin()->getColor("normal::font"),
|
||||||
true, true /* vcenter */, NULL);
|
true, true /* vcenter */, NULL);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -537,7 +537,7 @@ void RaceGUIOverworld::drawGlobalMiniMap()
|
|||||||
irr_driver->getActualScreenSize().Width,
|
irr_driver->getActualScreenSize().Width,
|
||||||
irr_driver->getActualScreenSize().Height);
|
irr_driver->getActualScreenSize().Height);
|
||||||
GUIEngine::getOutlineFont()->draw(_("Press fire to start the challenge"), pos2,
|
GUIEngine::getOutlineFont()->draw(_("Press fire to start the challenge"), pos2,
|
||||||
video::SColor(255,255,150,60),
|
GUIEngine::getSkin()->getColor("normal::font"),
|
||||||
true, true /* vcenter */, NULL);
|
true, true /* vcenter */, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user