ScummVM API documentation
clicktext.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 STARK_UI_CLICK_TEXT_H
23 #define STARK_UI_CLICK_TEXT_H
24 
25 #include "engines/stark/gfx/color.h"
26 
27 #include "common/scummsys.h"
28 #include "common/rect.h"
29 #include "common/str.h"
30 
31 namespace Stark {
32 
33 class VisualText;
34 
35 class ClickText {
36 public:
37  ClickText(const Common::String &text, const Gfx::Color &color);
38  ~ClickText();
39 
40  void setPosition(const Common::Point &pos) { _position = pos; }
41  void render();
42  bool containsPoint(const Common::Point &point) const;
43  int getHeight() const { return _bbox.height(); }
44 
45  void setActive() { _curVisual = _visualActive; }
46  void setPassive() { _curVisual = _visualPassive; }
47 
48 private:
49  VisualText *_visualPassive;
50  VisualText *_visualActive;
51  VisualText *_curVisual;
52  Common::Point _position;
53  Common::String _text;
54  Common::Rect _bbox;
55  Gfx::Color _color;
56 };
57 
58 } // End of namespace Stark
59 
60 #endif // STARK_UI_CLICK_TEXT_H
Definition: str.h:59
Definition: clicktext.h:35
Definition: rect.h:144
Definition: text.h:44
Definition: console.h:27
Definition: rect.h:45
Definition: color.h:30
int16 height() const
Definition: rect.h:192