0bc3e7e34a1963813bd44f0d6d41b66cbe1d3243
[supertux.git] / src / object / text_object.h
1 #ifndef __TEXTOBJECT_H__
2 #define __TEXTOBJECT_H__
3
4 #include "game_object.h"
5 #include "scripting/text.h"
6
7 class Font;
8
9 /** A text object intended for scripts that want to tell a story */
10 class TextObject : public GameObject, public Scripting::Text
11 {
12 public:
13   TextObject();
14   virtual ~TextObject();
15
16   void set_text(const std::string& text);
17   void set_font(const std::string& name);
18   void fade_in(float fadetime);
19   void fade_out(float fadetime);
20   void set_visible(bool visible);
21   bool is_visible();
22
23   void draw(DrawingContext& context);
24   void update(float elapsed_time);
25
26 private:
27   Font* font;
28   std::string text;
29   float fading;
30   float fadetime;
31   bool visible;
32 };
33
34 #endif
35