diff options
author | eray orçunus <erayorcunus@gmail.com> | 2019-06-25 14:48:55 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2019-06-25 14:48:55 +0200 |
commit | dae78282d852bb633b28dacd1203b3b566c42076 (patch) | |
tree | 842f9411381d732839126217b17807648da04e9c /src/render/Font.h | |
parent | Fix car animations & M16 bug (diff) | |
parent | Frontend clean up (diff) | |
download | re3-dae78282d852bb633b28dacd1203b3b566c42076.tar re3-dae78282d852bb633b28dacd1203b3b566c42076.tar.gz re3-dae78282d852bb633b28dacd1203b3b566c42076.tar.bz2 re3-dae78282d852bb633b28dacd1203b3b566c42076.tar.lz re3-dae78282d852bb633b28dacd1203b3b566c42076.tar.xz re3-dae78282d852bb633b28dacd1203b3b566c42076.tar.zst re3-dae78282d852bb633b28dacd1203b3b566c42076.zip |
Diffstat (limited to 'src/render/Font.h')
-rw-r--r-- | src/render/Font.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/render/Font.h b/src/render/Font.h index 2e698533..11c0f8ec 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -33,6 +33,12 @@ enum { FONT_HEADING, }; +enum { + ALIGN_LEFT, + ALIGN_CENTER, + ALIGN_RIGHT, +}; + class CFont { static CFontDetails &Details; @@ -56,6 +62,7 @@ public: static void DrawFonts(void); static uint16 character_code(uint8 c); + static CFontDetails GetDetails() { return Details; } static void SetScale(float x, float y) { Details.scaleX = x; Details.scaleY = y; } static void SetSlantRefPoint(float x, float y) { Details.slantRefX = x; Details.slantRefY = y; } static void SetSlant(float s) { Details.slant = s; } @@ -86,6 +93,23 @@ public: static void SetCentreOff(void) { Details.centre = false; } + static void SetAlignment(uint8 alignment) { + if (alignment == ALIGN_LEFT) { + CFont::Details.justify = true; + CFont::Details.centre = false; + CFont::Details.rightJustify = false; + } + else if (alignment == ALIGN_CENTER) { + CFont::Details.justify = false; + CFont::Details.centre = true; + CFont::Details.rightJustify = false; + } + else if (alignment == ALIGN_RIGHT) { + CFont::Details.justify = false; + CFont::Details.centre = false; + CFont::Details.rightJustify = true; + } + } static void SetWrapx(float x) { Details.wrapX = x; } static void SetCentreSize(float s) { Details.centreSize = s; } static void SetBackgroundOn(void) { Details.background = true; } |