diff options
author | Darkvater <darkvater@openttd.org> | 2005-07-17 15:54:57 +0000 |
---|---|---|
committer | Darkvater <darkvater@openttd.org> | 2005-07-17 15:54:57 +0000 |
commit | 7fceed04463b5fef6e4fd0fceddfe74265dcd93a (patch) | |
tree | 5dc2b2df070116a5f093c53eff95a89dd909c671 /gfx.h | |
parent | a09342c1fcaff8946dfd4fb859bf917d5b9975af (diff) | |
download | openttd-7fceed04463b5fef6e4fd0fceddfe74265dcd93a.tar.xz |
(svn r2607) - Feature: add support for truncating strings to a given (pixel) length. Function courtesy of Ludde.
Diffstat (limited to 'gfx.h')
-rw-r--r-- | gfx.h | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -35,11 +35,22 @@ typedef struct CursorVars { void RedrawScreenRect(int left, int top, int right, int bottom); void GfxScroll(int left, int top, int width, int height, int xo, int yo); -int DrawStringCentered(int x, int y, uint16 str, uint16 color); -int DrawString(int x, int y, uint16 str, uint16 color); -void DrawStringCenterUnderline(int x, int y, uint16 str, uint16 color); + +int DrawStringCentered(int x, int y, StringID str, uint16 color); +int DrawStringCenteredTruncated(int x, int y, StringID str, uint16 color, uint maxw); + +int DrawString(int x, int y, StringID str, uint16 color); +int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw); + int DoDrawString(const char *string, int x, int y, uint16 color); -void DrawStringRightAligned(int x, int y, uint16 str, uint16 color); +int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw); + +void DrawStringCenterUnderline(int x, int y, StringID str, uint16 color); +void DrawStringCenterUnderlineTruncated(int x, int y, StringID str, uint16 color, uint maxw); + +void DrawStringRightAligned(int x, int y, StringID str, uint16 color); +void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw); + void GfxFillRect(int left, int top, int right, int bottom, int color); void GfxDrawLine(int left, int top, int right, int bottom, int color); void DrawFrameRect(int left, int top, int right, int bottom, int color, int flags); |