modified font size so deck name fits on screen when selecting deck for game play.

This commit is contained in:
techdragon.nguyen@gmail.com
2010-11-09 05:45:24 +00:00
parent 17c358cb12
commit 164f2c5205
4 changed files with 17 additions and 26 deletions

View File

@@ -4,10 +4,6 @@
#include "Translate.h"
#include "WResourceManager.h"
namespace
{
const float kMaxDeckNameWidth = 180; // pixel width
}
DeckMenuItem::DeckMenuItem(DeckMenu* _parent, int id, int fontId, string text, float x, float y, bool hasFocus, bool autoTranslate, DeckMetaData *deckMetaData)
: JGuiObject(id), parent(_parent), fontId(fontId), mX(x), mY(y)
@@ -34,8 +30,6 @@ void DeckMenuItem::RenderWithOffset(float yOffset)
{
WFont * mFont = resources.GetWFont(fontId);
string displayName = mText;
while ( mFont->GetStringWidth( displayName.c_str() ) > kMaxDeckNameWidth )
displayName = displayName.substr(0, displayName.size() - 1 );
mFont->DrawString(displayName.c_str(), mX, mY + yOffset, JGETEXT_CENTER);
}