OpenXcom  1.0
Open-source clone of the original X-Com
BattlescapeMessage.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 <string>
21 #include "../Engine/Surface.h"
22 
23 namespace OpenXcom
24 {
25 
26 class Window;
27 class Text;
28 class Font;
29 
35 {
36 private:
37  Window *_window;
38  Text *_text;
39 public:
41  BattlescapeMessage(int width, int height, int x = 0, int y = 0);
45  void setX(int x);
47  void setY(int y);
49  void setBackground(Surface *background);
51  void setText(const std::string &message);
53  void initText(Font *big, Font *small, Language *lang);
55  void setPalette(SDL_Color *colors, int firstcolor = 0, int ncolors = 256);
57  void blit(Surface *surface);
59  void setHeight(int height);
61  void setTextColor(Uint8 color);
62 };
63 
64 }
void initText(Font *big, Font *small, Language *lang)
Initializes the Battlescape message&#39;s resources.
Definition: BattlescapeMessage.cpp:105
void setText(const std::string &message)
Sets the Battlescape message&#39;s text.
Definition: BattlescapeMessage.cpp:91
Box with a coloured border and custom background.
Definition: Window.h:40
Text string displayed on screen.
Definition: Text.h:40
Contains strings used throughout the game for localization.
Definition: Language.h:39
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:46
void setX(int x)
Sets the X position of the surface.
Definition: BattlescapeMessage.cpp:60
void setBackground(Surface *background)
Sets the Battlescape message&#39;s background.
Definition: BattlescapeMessage.cpp:82
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
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:34
void setY(int y)
Sets the Y position of the surface.
Definition: BattlescapeMessage.cpp:71
void setTextColor(Uint8 color)
Sets the text color of the battlescape message.
Definition: BattlescapeMessage.cpp:149
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&#39;s palette.
Definition: BattlescapeMessage.cpp:117
Definition: BaseInfoState.cpp:40