ScummVM API documentation
gfx_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 GRAPHICS_VIEWS_GFX_SURFACE_H
23#define GRAPHICS_VIEWS_GFX_SURFACE_H
24
25#include "common/ptr.h"
26#include "common/rect.h"
27#include "graphics/font.h"
28#include "graphics/managed_surface.h"
29#include "graphics/views/rect.h"
30
31namespace Graphics {
32namespace Views {
33
35private:
37 Common::Point _textPos;
38 byte _textColor = 255;
39 byte _bgColor = 0;
40 bool _scrollable = false;
41
42 void newLine();
43
44public:
45 GfxSurface();
47
51 void writeString(const Common::Point &pt, const Common::String &str,
54 void writeString(const Common::Point &pt, const char *str, ...);
55 void writeString(const char *str, ...);
56
61 void writeChar(uint32 chr);
62 void writeChar(const Common::Point &pt, uint32 chr);
63
69 int getStringWidth(const Common::String &str) const;
70
71 void setTextPos(const Common::Point &pt);
72 const Common::Point &getTextPos() const {
73 return _textPos;
74 }
75
81 byte setColor(byte color);
82 void setColor(byte fgColor, byte bgColor);
83
88
93 void setScrollable(bool flag) {
94 _scrollable = flag;
95 }
96
100 void xorBlitFrom(const ManagedSurface &src, const Common::Point &destPos);
101 void xorBlitFrom(const ManagedSurface &src, const Common::Rect &srcRect, const Common::Point &destPos);
102};
103
104} // namespace Views
105} // namespace Graphics
106
107#endif
Definition: str.h:59
Definition: managed_surface.h:51
Definition: gfx_surface.h:34
int getStringWidth(const Common::String &str) const
void xorBlitFrom(const ManagedSurface &src, const Common::Point &destPos)
byte setColor(byte color)
void setScrollable(bool flag)
Definition: gfx_surface.h:93
void writeString(const Common::Point &pt, const Common::String &str, Graphics::TextAlign align=Graphics::kTextAlignLeft)
void writeChar(uint32 chr)
TextAlign
Definition: font.h:48
@ kTextAlignLeft
Align the text to the left.
Definition: font.h:51
Definition: formatinfo.h:28
Definition: rect.h:144
Definition: rect.h:536