- Added a way to name and describe AI Decks. Let's find cool names and descriptions :)
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-05-25 12:43:58 +00:00
parent fc2ae93367
commit ee58109449
12 changed files with 100 additions and 36 deletions

View File

@@ -102,23 +102,31 @@ JLBFont::~JLBFont()
void JLBFont::DrawString(const char *string, float x, float y, int align, float leftOffset, float displayWidth)
{
char *p = (char*)string;
float dx = x, dy = y;
float dx0 = x, dy = y;
if (mQuad == NULL) return;
float width = GetStringWidth(string);
if (align == JGETEXT_RIGHT)
dx -= width;
dx0 -= width;
else if (align == JGETEXT_CENTER)
dx -= width/2;
dx0 -= width/2;
dx = floorf(dx);
float dx = floorf(dx0);
dy = floorf(dy);
float x0 = dx;
int index;
while (*p)
{
if (*p == '\n') {
p++;
dy += (mHeight * 1.1 * mScale);
dy = floorf(dy);
dx = dx0;
continue;
}
index = (*p - 32)+mBase;
float charWidth = mCharWidth[index];
float delta = (charWidth + mTracking) * mScale;