ScummVM API documentation
screentext.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program 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  * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ILLUSIONS_SCREENTEXT_H
23 #define ILLUSIONS_SCREENTEXT_H
24 
25 #include "illusions/graphics.h"
26 #include "common/list.h"
27 #include "common/rect.h"
28 #include "graphics/surface.h"
29 
30 namespace Illusions {
31 
32 #define TEXT_FLAG_LEFT_ALIGN 1
33 #define TEXT_FLAG_CENTER_ALIGN 2
34 #define TEXT_FLAG_RIGHT_ALIGN 4
35 #define TEXT_FLAG_BORDER_DECORATION 24
36 
37 class IllusionsEngine;
38 class FontResource;
39 
41  Common::Point _position;
42  WidthHeight _dimensions;
43  Common::Point _offsPt;
44  uint32 _fontId;
45  uint16 _backgroundColor;
46  uint16 _borderColor;
47  byte _colorR, _colorG, _colorB;
48  uint _flags;
49 };
50 
52  ScreenTextInfo _info;
53  uint16 _text[1024];
54 };
55 
56 class ScreenText {
57 public:
59  ~ScreenText();
60  void getTextInfoDimensions(WidthHeight &textInfoDimensions);
61  void getTextInfoPosition(Common::Point &position);
62  void setTextInfoPosition(Common::Point position);
63  void updateTextInfoPosition(Common::Point position);
64  void clipTextInfoPosition(Common::Point &position);
65  bool refreshScreenText(FontResource *font, WidthHeight dimensions, Common::Point offsPt,
66  uint16 *text, uint textFlags, uint16 backgroundColor, uint16 borderColor, uint16 *&outTextPtr);
67  bool insertText(uint16 *text, uint32 fontId, WidthHeight dimensions, Common::Point offsPt, uint flags,
68  uint16 backgroundColor, uint16 borderColor, byte colorR, byte colorG, byte colorB, uint16 *&outTextPtr);
69  void removeText();
70  void clearText();
71 public:
72  IllusionsEngine *_vm;
73  Common::Point _position;
74  WidthHeight _dimensions;
75  Graphics::Surface *_surface;
76  Common::List<ScreenTextEntry*> _screenTexts;
77  void freeTextSurface();
78 };
79 
80 } // End of namespace Illusions
81 
82 #endif // ILLUSIONS_SCREENTEXT_H
Definition: fontresource.h:60
Definition: surface.h:67
Definition: list.h:44
Definition: actor.h:34
Definition: graphics.h:31
Definition: screentext.h:51
Definition: rect.h:45
Definition: screentext.h:56
Definition: screentext.h:40
Definition: illusions.h:92