OpenXcom  1.0
Open-source clone of the original X-Com
NumberText.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/Surface.h"
21 
22 namespace OpenXcom
23 {
24 
29 class NumberText : public Surface
30 {
31 private:
32  unsigned int _value;
33  Surface *_chars[10];
34  Surface *_borderedChars[10];
35  bool _bordered;
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();
55  void setBordered(bool bordered);
56 
57 };
58 
59 }
unsigned int getValue() const
Gets the number text&#39;s value.
Definition: NumberText.cpp:230
Uint8 getColor() const
Gets the number text&#39;s color.
Definition: NumberText.cpp:249
void setValue(unsigned int value)
Sets the number text&#39;s value.
Definition: NumberText.cpp:220
void setColor(Uint8 color)
Sets the number text&#39;s color.
Definition: NumberText.cpp:239
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:207
void draw()
Draws the number text.
Definition: NumberText.cpp:273
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the number text&#39;s palette.
Definition: NumberText.cpp:260
void setBordered(bool bordered)
sets this numbertext to have a border or not
Definition: NumberText.cpp:304
Number digits displayed on the screen.
Definition: NumberText.h:29
Definition: BaseInfoState.cpp:40