diff options
author | Peter Nelson <peter1138@openttd.org> | 2021-04-19 12:12:07 +0100 |
---|---|---|
committer | PeterN <peter@fuzzle.org> | 2021-04-22 16:42:04 +0100 |
commit | 636e37d1832dbcb3aa12c915ede5a9d26d231d24 (patch) | |
tree | 5c8deb467b921a934f8817c042680b160de99bc8 /src/gfx_func.h | |
parent | 2a0365b3d992fb602fd91b218b4a8647ddb46975 (diff) | |
download | openttd-636e37d1832dbcb3aa12c915ede5a9d26d231d24.tar.xz |
Codechange: Add internal widget alignment property, along with widget part.
Diffstat (limited to 'src/gfx_func.h')
-rw-r--r-- | src/gfx_func.h | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/gfx_func.h b/src/gfx_func.h index e8f7d0345..a4db8a045 100644 --- a/src/gfx_func.h +++ b/src/gfx_func.h @@ -91,24 +91,6 @@ Dimension GetSpriteSize(SpriteID sprid, Point *offset = nullptr, ZoomLevel zoom void DrawSpriteViewport(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub = nullptr); void DrawSprite(SpriteID img, PaletteID pal, int x, int y, const SubSprite *sub = nullptr, ZoomLevel zoom = ZOOM_LVL_GUI); -/** How to align the to-be drawn text. */ -enum StringAlignment { - SA_LEFT = 0 << 0, ///< Left align the text. - SA_HOR_CENTER = 1 << 0, ///< Horizontally center the text. - SA_RIGHT = 2 << 0, ///< Right align the text (must be a single bit). - SA_HOR_MASK = 3 << 0, ///< Mask for horizontal alignment. - - SA_TOP = 0 << 2, ///< Top align the text. - SA_VERT_CENTER = 1 << 2, ///< Vertically center the text. - SA_BOTTOM = 2 << 2, ///< Bottom align the text. - SA_VERT_MASK = 3 << 2, ///< Mask for vertical alignment. - - SA_CENTER = SA_HOR_CENTER | SA_VERT_CENTER, ///< Center both horizontally and vertically. - - SA_FORCE = 1 << 4, ///< Force the alignment, i.e. don't swap for RTL languages. -}; -DECLARE_ENUM_AS_BIT_SET(StringAlignment) - int DrawString(int left, int right, int top, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); int DrawString(int left, int right, int top, StringID str, TextColour colour = TC_FROMSTRING, StringAlignment align = SA_LEFT, bool underline = false, FontSize fontsize = FS_NORMAL); int DrawStringMultiLine(int left, int right, int top, int bottom, const char *str, TextColour colour = TC_FROMSTRING, StringAlignment align = (SA_TOP | SA_LEFT), bool underline = false, FontSize fontsize = FS_NORMAL); |