HOG2
TextBox.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 TEXTBOX_H
17 #define TEXTBOX_H
18 
19 class TextBox {
20 public:
21  TextBox(char *text, int charLine, point3d topLeft, point3d bottomRight, double duration=4, bool deform=true, bool scrolling = false); // start coord (3), velocity(3)
22  ~TextBox();
23  void stepTime(double amount);
24  void draw();
26  void destroy();
27  void setColor(rgbColor _myColor) { myColor = _myColor; }
28 private:
29  void drawLine(point3d where, int startx, int starty, int offsetx, int offsety, double scale);
30  void drawChar(char c, point3d where, double height);
31  uint32_t getBitmap(char c);
34  char *text;
35  int charLine;
37  double elapsedTime;
38  double duration;
39  GLuint dList;
40 };
41 
42 #endif
43 
rgbColor
A color; r/g/b are between 0...1.
Definition: Colors.h:17
TextBox
Definition: TextBox.h:19
TextBox::charLine
int charLine
Definition: TextBox.h:35
TextBox::getLocation
point3d getLocation()
Definition: TextBox.cpp:143
TextBox::setColor
void setColor(rgbColor _myColor)
Definition: TextBox.h:27
TextBox::elapsedTime
double elapsedTime
Definition: TextBox.h:37
TextBox::scrolling
bool scrolling
Definition: TextBox.h:36
TextBox::draw
void draw()
Definition: TextBox.cpp:46
TextBox::~TextBox
~TextBox()
Definition: TextBox.cpp:29
TextBox::duration
double duration
Definition: TextBox.h:38
TextBox::getBitmap
uint32_t getBitmap(char c)
Definition: TextBox.cpp:202
TextBox::drawChar
void drawChar(char c, point3d where, double height)
Definition: TextBox.cpp:158
point3d
#define point3d
Definition: GLUtil.h:123
TextBox::destroy
void destroy()
Definition: TextBox.cpp:36
height
int height
Definition: SFML_HOG.cpp:54
GLUtil.h
TextBox::TextBox
TextBox(char *text, int charLine, point3d topLeft, point3d bottomRight, double duration=4, bool deform=true, bool scrolling=false)
Definition: TextBox.cpp:15
TextBox::stepTime
void stepTime(double amount)
Definition: TextBox.cpp:41
TextBox::dList
GLuint dList
Definition: TextBox.h:39
TextBox::myColor
rgbColor myColor
Definition: TextBox.h:33
TextBox::text
char * text
Definition: TextBox.h:34
TextBox::deform
bool deform
Definition: TextBox.h:36
TextBox::tl
point3d tl
Definition: TextBox.h:32
TextBox::drawLine
void drawLine(point3d where, int startx, int starty, int offsetx, int offsety, double scale)
Definition: TextBox.cpp:374
TextBox::br
point3d br
Definition: TextBox.h:32