(svn r5967) -Change: use right alignment for the year in the player's balance window instead of centering (about) 'string width' / 2 from the right edge

This commit is contained in:
rubidium
2006-08-20 10:50:23 +00:00
parent 5ae6080913
commit e2ce56144e
3 changed files with 15 additions and 4 deletions

14
gfx.c
View File

@@ -352,12 +352,16 @@ int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw)
}
void DrawStringRightAligned(int x, int y, StringID str, uint16 color)
int DrawStringRightAligned(int x, int y, StringID str, uint16 color)
{
char buffer[512];
int w;
GetString(buffer, str);
DoDrawString(buffer, x - GetStringWidth(buffer), y, color);
w = GetStringWidth(buffer);
DoDrawString(buffer, x - w, y, color);
return w;
}
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw)
@@ -368,6 +372,12 @@ void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, u
DoDrawString(buffer, x - GetStringWidth(buffer), y, color);
}
void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color)
{
int w = DrawStringRightAligned(x, y, str, color);
GfxFillRect(x - w, y + 10, x, y + 10, _string_colorremap[1]);
}
int DrawStringCentered(int x, int y, StringID str, uint16 color)
{