forked from mirror/OpenTTD
(svn r2644) - Fix: my name was mistyped ;p
- Add DoDrawStringCentered() and change the multiline strings in the about box to single-line ones
This commit is contained in:
7
gfx.c
7
gfx.c
@@ -365,6 +365,13 @@ int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 colo
|
||||
return DoDrawString(buffer, (xl + xr - w) / 2, y, color);
|
||||
}
|
||||
|
||||
int DoDrawStringCentered(int x, int y, const char *str, uint16 color)
|
||||
{
|
||||
int w = GetStringWidth(str);
|
||||
DoDrawString(str, x - w / 2, y, color);
|
||||
return w;
|
||||
}
|
||||
|
||||
void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color)
|
||||
{
|
||||
int w = DrawStringCentered(x, y, str, color);
|
||||
|
Reference in New Issue
Block a user