use the tree sounds
[supertux.git] / src / textscroller.hpp
index b9c534c..cc166dc 100644 (file)
 #include <map>
 
 #include "screen.hpp"
-#include "video/font.hpp"
+#include "math/vector.hpp"
+#include "math/rect.hpp"
 
 class DrawingContext;
 class Surface;
+class Font;
 
 /**
  * Helper class for InfoBox: Represents a line of text
  */
 class InfoBoxLine
 {
-private:
+public:
   enum LineType { NORMAL, NORMAL_LEFT, SMALL, HEADING, REFERENCE, IMAGE};
-  LineType lineType;
-  Font* font;
-  std::string text;
-  Surface* image; 
 
-public:
   InfoBoxLine(char format_char, const std::string& text);
   ~InfoBoxLine();
 
-  void draw(DrawingContext& context, const Vector& position, int layer);
+  void draw(DrawingContext& context, const Rect& bbox, int layer);
   float get_height();
 
-  static const std::vector<InfoBoxLine*> split(const std::string& text, int line_length);
+  static const std::vector<InfoBoxLine*> split(const std::string& text, float width);
+
+private:
+  InfoBoxLine::LineType lineType;
+  Font* font;
+  std::string text;
+  Surface* image;
 };
 
 /** This class is displaying a box with information text inside the game
@@ -66,7 +69,7 @@ public:
   void scrollup();
   void pagedown();
   void pageup();
-  
+
 private:
   size_t firstline;
   std::vector<InfoBoxLine*> lines;
@@ -96,4 +99,3 @@ private:
 };
 
 #endif
-