本文整理汇总了C++中PlayerProfile::getNumMediumTrophies方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerProfile::getNumMediumTrophies方法的具体用法?C++ PlayerProfile::getNumMediumTrophies怎么用?C++ PlayerProfile::getNumMediumTrophies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerProfile
的用法示例。
在下文中一共展示了PlayerProfile::getNumMediumTrophies方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawTrophyPoints
/** Displays the number of challenge trophies
*/
void RaceGUIOverworld::drawTrophyPoints()
{
PlayerProfile *player = PlayerManager::get()->getCurrentPlayer();
const int points = player->getPoints();
std::string s = StringUtils::toString(points);
core::stringw sw(s.c_str());
static video::SColor time_color = video::SColor(255, 255, 255, 255);
int dist_from_right = 10 + m_trophy_points_width;
core::rect<s32> pos(UserConfigParams::m_width - dist_from_right, 10,
UserConfigParams::m_width , 50);
bool vcenter = false;
gui::ScalableFont* font = GUIEngine::getFont();
vcenter = true;
const int size = UserConfigParams::m_width/20;
core::rect<s32> dest(size, pos.UpperLeftCorner.Y,
size*2, pos.UpperLeftCorner.Y + size);
core::rect<s32> source(core::position2di(0, 0), m_trophy3->getSize());
font->setShadow(video::SColor(255,0,0,0));
if (!m_close_to_a_challenge)
{
draw2DImage(m_trophy1, dest, source, NULL,
NULL, true /* alpha */);
}
dest += core::position2di((int)(size*1.5f), 0);
std::string easyTrophies = StringUtils::toString(player->getNumEasyTrophies());
core::stringw easyTrophiesW(easyTrophies.c_str());
if (!m_close_to_a_challenge)
{
font->draw(easyTrophiesW.c_str(), dest, time_color, false, vcenter, NULL, true /* ignore RTL */);
}
dest += core::position2di(size*2, 0);
if (!m_close_to_a_challenge)
{
draw2DImage(m_trophy2, dest, source, NULL,
NULL, true /* alpha */);
}
dest += core::position2di((int)(size*1.5f), 0);
std::string mediumTrophies = StringUtils::toString(player->getNumMediumTrophies());
core::stringw mediumTrophiesW(mediumTrophies.c_str());
if (!m_close_to_a_challenge)
{
font->draw(mediumTrophiesW.c_str(), dest, time_color, false, vcenter, NULL, true /* ignore RTL */);
}
dest += core::position2di(size*2, 0);
if (!m_close_to_a_challenge)
{
draw2DImage(m_trophy3, dest, source, NULL,
NULL, true /* alpha */);
}
dest += core::position2di((int)(size*1.5f), 0);
std::string hardTrophies = StringUtils::toString(player->getNumHardTrophies());
core::stringw hardTrophiesW(hardTrophies.c_str());
if (!m_close_to_a_challenge)
{
font->draw(hardTrophiesW.c_str(), dest, time_color, false, vcenter, NULL, true /* ignore RTL */);
}
dest = core::rect<s32>(pos.UpperLeftCorner.X - size - 5, pos.UpperLeftCorner.Y,
pos.UpperLeftCorner.X - 5, pos.UpperLeftCorner.Y + size);
draw2DImage(m_open_challenge, dest, source, NULL,
NULL, true /* alpha */);
pos.LowerRightCorner.Y = dest.LowerRightCorner.Y;
pos.UpperLeftCorner.X += 5;
font->draw(sw.c_str(), pos, time_color, false, vcenter, NULL, true /* ignore RTL */);
font->disableShadow();
} // drawTrophyPoints