ScummVM API documentation
visual_surface.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 ULTIMA_SHARED_GFX_VISUAL_SURFACE_H
23 #define ULTIMA_SHARED_GFX_VISUAL_SURFACE_H
24 
25 #include "graphics/managed_surface.h"
26 #include "ultima/shared/core/named_item.h"
27 #include "ultima/shared/core/rect.h"
28 #include "ultima/shared/gfx/screen.h"
29 
30 namespace Ultima {
31 namespace Shared {
32 
33 class GameBase;
34 
35 namespace Gfx {
36 
37 class Font;
38 
40 private:
41  Rect _bounds;
42  Point _textPos;
43  byte _textColor;
44  byte _bgColor;
45 public:
49  VisualSurface(const Graphics::ManagedSurface &src, const Rect &bounds, GameBase *game = nullptr);
50 
54  void drawPoint(const Point &pt, byte color);
55 
59  void setTextPos(const Point &pt) { _textPos = pt; }
60 
64  void writeString(const Common::String &msg, const Point &pt, int color = -1, int bgColor = -1);
65 
69  void writeString(const Common::String &msg, int color = -1, int bgColor = -1);
70 
74  void writeChar(unsigned char c, const Point &pt, int color = -1, int bgColor = -1);
75 
79  void writeChar(unsigned char c, int color = -1, int bgColor = -1);
80 
84  size_t fontHeight();
85 };
86 
87 } // End of namespace Gfx
88 } // End of namespace Shared
89 } // End of namespace Ultima
90 
91 #endif
Definition: managed_surface.h:51
void setTextPos(const Point &pt)
Definition: visual_surface.h:59
Definition: str.h:59
void writeChar(unsigned char c, const Point &pt, int color=-1, int bgColor=-1)
Definition: visual_surface.h:39
Definition: rect.h:144
void drawPoint(const Point &pt, byte color)
void writeString(const Common::String &msg, const Point &pt, int color=-1, int bgColor=-1)
Definition: detection.h:27
Definition: game_base.h:53
Definition: rect.h:45
VisualSurface(const Graphics::ManagedSurface &src, const Rect &bounds, GameBase *game=nullptr)