OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NumberText.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_NUMBERTEXT_H
20 #define OPENXCOM_NUMBERTEXT_H
21 
22 #include "../Engine/Surface.h"
23 
24 namespace OpenXcom
25 {
26 
31 class NumberText : public Surface
32 {
33 private:
34  unsigned int _value;
35  Surface *_chars[10];
36  Uint8 _color;
37 public:
39  NumberText(int width, int height, int x = 0, int y = 0);
41  ~NumberText();
43  void setValue(unsigned int value);
45  unsigned int getValue() const;
47  void setColor(Uint8 color);
49  Uint8 getColor() const;
51  void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
53  void draw();
54 };
55 
56 }
57 
58 #endif
void setValue(unsigned int value)
Sets the number text's value.
Definition: NumberText.cpp:197
unsigned int getValue() const
Gets the number text's value.
Definition: NumberText.cpp:207
void setColor(Uint8 color)
Sets the number text's color.
Definition: NumberText.cpp:216
NumberText(int width, int height, int x=0, int y=0)
Creates a new number text with the specified size and position.
Definition: NumberText.cpp:33
~NumberText()
Cleans up the number text.
Definition: NumberText.cpp:185
void draw()
Draws the number text.
Definition: NumberText.cpp:249
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
Uint8 getColor() const
Gets the number text's color.
Definition: NumberText.cpp:226
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the number text's palette.
Definition: NumberText.cpp:237
Number digits displayed on the screen.
Definition: NumberText.h:31