-Some cleanups in text scrolling code
[supertux.git] / src / textscroller.h
1 #ifndef __TEXTSCROLLER_H__
2 #define __TEXTSCROLLER_H__
3
4 #include <vector>
5 #include <string>
6
7 namespace SuperTux {
8 class DrawingContext;
9 }
10
11 using namespace SuperTux;
12
13 /** This class is displaying a box with information text inside the game
14  */
15 class InfoBox
16 {
17 public:
18   InfoBox(const std::string& text);
19   ~InfoBox();
20
21   void draw(DrawingContext& context);
22   void scrolldown();
23   void scrollup();
24   void pagedown();
25   void pageup();
26   
27 private:
28   size_t firstline;
29   std::vector<std::string> lines;
30 };
31
32 /** Reads a text file (using LispReader, so it as to be in its formatting)
33  * and scroll it over the screen
34  * (this call blocks until all text scrolled through or the user aborted the
35  *  textscrolling)
36  */
37 void display_text_file(const std::string& file);
38
39 #endif
40