Adonthell  0.4
text_bubble.h
Go to the documentation of this file.
1 /*
2  $Id: text_bubble.h,v 1.2 2001/08/31 15:34:10 gnurou Exp $
3 
4  Copyright (C) 2001 Kai Sterker <kaisterker@linuxgames.com>
5  Copyright (C) 2001 Alexandre Courbot <alexandrecourbot@linuxgames.com>
6  Part of the Adonthell Project http://adonthell.linuxgames.com
7 
8  This program is free software; you can redistribute it and/or modify
9  it under the terms of the GNU General Public License.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 
17 /**
18  * @file text_bubble.h
19  * @author Kai Sterker <kaisterker@linuxgames.com>
20  * @author Alexandre Courbot <alexandrecourbot@linuxgames.com>
21  *
22  * @brief Declares the text_bubble class.
23  *
24  *
25  */
26 
27 
28 #ifndef TEXT_BUBBLE_H_
29 #define TEXT_BUBBLE_H_
30 
31 #include "win_label.h"
32 #include "win_theme.h"
33 
34 
35 /**
36  * Displays neat little text speech bubbles.
37  *
38  * This class makes text bubbles designed to stay visible
39  * a short amount of time (just enough to be read).
40  *
41  */
42 class text_bubble : public win_label
43 {
44 public:
45  /**
46  * Constructor.
47  *
48  * @param text Text to display in that bubble.
49  * @param textcolor Font to use with this bubble (directly taken from the
50  * win_manager's font collection).
51  * @param themename Theme to use with this bubble (directly taken from the
52  * win_manager's theme collection).
53  * @param len Basic duration (in %game cycles) of this bubble. Another amount
54  * of time will be added, depending on it's length.
55  *
56  */
57  text_bubble (const string & text, const string & textcolor, const string & themename,
58  u_int16 len = 110);
59 
60  /**
61  * Destructor.
62  *
63  */
64  ~text_bubble ();
65 
66  /**
67  * Update function.
68  *
69  * @return \e false if the bubble should be destroyed now, \e true otherwise.
70  */
71  bool update ();
72 
73  /**
74  * Returns the number of game cycles remaining before the death of this
75  * bubble.
76  *
77  * @return Number of game cycles remaining before the death of this bubble.
78  */
80  {
81  return remain;
82  }
83 
84 private:
85  /**
86  * Game cycles remaining before the death of this bubble.
87  *
88  */
89  u_int16 remain;
90 };
91 
92 #endif
Displays neat little text speech bubbles.
Definition: text_bubble.h:42
u_int16 remaining()
Returns the number of game cycles remaining before the death of this bubble.
Definition: text_bubble.h:79
text_bubble(const string &text, const string &textcolor, const string &themename, u_int16 len=110)
Constructor.
Definition: text_bubble.cc:31
#define u_int16
16 bits long unsigned integer
Definition: types.h:32
bool update()
Update function.
Definition: text_bubble.cc:57
~text_bubble()
Destructor.
Definition: text_bubble.cc:53