diff options
author | Darkvater <darkvater@openttd.org> | 2005-07-19 22:12:04 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-07-19 22:12:04 +0000 |
commit | f0c0c03c5f6eceafa0b10f40f413e893d02f34e8 (patch) | |
tree | 2510f3eedd1c2af25757fd24b0d1d4fd12437bc6 /gfx.c | |
parent | 7c694f25537097f380d7215082b42eea51e86815 (diff) | |
download | openttd-f0c0c03c5f6eceafa0b10f40f413e893d02f34e8.tar.xz |
(svn r2644) - Fix: my name was mistyped ;p
- Add DoDrawStringCentered() and change the multiline strings in the about box to single-line ones
Diffstat (limited to 'gfx.c')
-rw-r--r-- | gfx.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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); |