OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
BattlescapeMessage.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_BATTLESCAPEMESSAGE_H
20 #define OPENXCOM_BATTLESCAPEMESSAGE_H
21 
22 #include <string>
23 #include "../Engine/Surface.h"
24 
25 namespace OpenXcom
26 {
27 
28 class Window;
29 class Text;
30 class Font;
31 
37 {
38 private:
39  Window *_window;
40  Text *_text;
41 public:
43  BattlescapeMessage(int width, int height, int x = 0, int y = 0);
47  void setX(int x);
49  void setY(int y);
51  void setBackground(Surface *background);
53  void setText(const std::wstring &message);
55  void initText(Font *big, Font *small, Language *lang);
57  void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
59  void blit(Surface *surface);
61  void setHeight(int height);
62 };
63 
64 }
65 
66 #endif
void initText(Font *big, Font *small, Language *lang)
Initializes the Battlescape message's resources.
Definition: BattlescapeMessage.cpp:105
Box with a coloured border and custom background.
Definition: Window.h:42
Text string displayed on screen.
Definition: Text.h:41
Contains strings used throughout the game for localization.
Definition: Language.h:42
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:40
void setX(int x)
Sets the X position of the surface.
Definition: BattlescapeMessage.cpp:60
void setBackground(Surface *background)
Sets the Battlescape message's background.
Definition: BattlescapeMessage.cpp:82
void setText(const std::wstring &message)
Sets the Battlescape message's text.
Definition: BattlescapeMessage.cpp:91
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
BattlescapeMessage(int width, int height, int x=0, int y=0)
Creates a new Battlescape message with the specified size and position.
Definition: BattlescapeMessage.cpp:34
~BattlescapeMessage()
Cleans up the Battlescape message.
Definition: BattlescapeMessage.cpp:50
Generic window used to display messages over the Battlescape map.
Definition: BattlescapeMessage.h:36
void setY(int y)
Sets the Y position of the surface.
Definition: BattlescapeMessage.cpp:71
void blit(Surface *surface)
Blits the warning message.
Definition: BattlescapeMessage.cpp:127
void setHeight(int height)
Special handling for setting the height of the battlescape message.
Definition: BattlescapeMessage.cpp:138
void setPalette(SDL_Color *colors, int firstcolor=0, int ncolors=256)
Sets the Battlescape message's palette.
Definition: BattlescapeMessage.cpp:117