HOG2
MonoFont.h
Go to the documentation of this file.
1 /*
2  * $Id: TextBox.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 10/18/06.
6  * Modified by Nathan Sturtevant on 02/29/20.
7  *
8  * This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
9  *
10  */
11 
12 #include "GLUtil.h"
13 #include <ctype.h>
14 #include <stdint.h>
15 
16 #ifndef MONOFONT_H
17 #define MONOFONT_H
18 
19 #include "Graphics.h"
20 
21 class MonoFont {
22 public:
23  void DrawText(Graphics::Display &display,
24  Graphics::point location, const char *text, float height,
25  const rgbColor &color = Colors::black,
28  void GetTextLines(std::vector<Graphics::Display::lineInfo> &lines,
29  Graphics::point location, const char *text, float height,
30  const rgbColor &color = Colors::black,
33 private:
34  void DrawLine(Graphics::Display &display, point3d where, int startx, int starty, int offsetx, int offsety, float scale, rgbColor color);
35  void DrawChar(Graphics::Display &display, char c, point3d where, float height, rgbColor color);
36  void DrawLine(std::vector<Graphics::Display::lineInfo> &lines, point3d where, int startx, int starty, int offsetx, int offsety, float scale, rgbColor color);
37  void DrawChar(std::vector<Graphics::Display::lineInfo> &lines, char c, point3d where, float height, rgbColor color);
38  uint32_t GetBitmap(char c);
39 };
40 #endif
41 
Graphics::point
Definition: Graphics.h:32
rgbColor
A color; r/g/b are between 0...1.
Definition: Colors.h:17
Graphics::textBaseline
textBaseline
Definition: Graphics.h:25
Colors::black
const rgbColor black
Definition: Colors.h:119
MonoFont::DrawChar
void DrawChar(Graphics::Display &display, char c, point3d where, float height, rgbColor color)
Definition: MonoFont.cpp:128
point3d
#define point3d
Definition: GLUtil.h:123
MonoFont
Definition: MonoFont.h:21
MonoFont::DrawText
void DrawText(Graphics::Display &display, Graphics::point location, const char *text, float height, const rgbColor &color=Colors::black, Graphics::textAlign align=Graphics::textAlignLeft, Graphics::textBaseline base=Graphics::textBaselineBottom)
Definition: MonoFont.cpp:73
MonoFont::DrawLine
void DrawLine(Graphics::Display &display, point3d where, int startx, int starty, int offsetx, int offsety, float scale, rgbColor color)
Definition: MonoFont.cpp:392
Graphics::Display
Definition: Graphics.h:146
height
int height
Definition: SFML_HOG.cpp:54
GLUtil.h
Graphics.h
MonoFont::GetBitmap
uint32_t GetBitmap(char c)
Definition: MonoFont.cpp:216
Graphics::textAlign
textAlign
Definition: Graphics.h:19
Graphics::textAlignLeft
@ textAlignLeft
Definition: Graphics.h:21
Graphics::textBaselineBottom
@ textBaselineBottom
Definition: Graphics.h:28
MonoFont::GetTextLines
void GetTextLines(std::vector< Graphics::Display::lineInfo > &lines, Graphics::point location, const char *text, float height, const rgbColor &color=Colors::black, Graphics::textAlign align=Graphics::textAlignLeft, Graphics::textBaseline base=Graphics::textBaselineBottom)
Definition: MonoFont.cpp:20