X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftextscroller.hpp;h=cc166dc35ea6612126054b389e97ee7fa8c244c3;hb=aec9bf199857d0ae1a5dc54cd96ae37177493deb;hp=5198eb9222fd29cebaf58d46c04876a58cd42662;hpb=7c579d3ef0a6667c18b53dad84c63c05d2760a84;p=supertux.git diff --git a/src/textscroller.hpp b/src/textscroller.hpp index 5198eb922..cc166dc35 100644 --- a/src/textscroller.hpp +++ b/src/textscroller.hpp @@ -27,6 +27,7 @@ #include "screen.hpp" #include "math/vector.hpp" +#include "math/rect.hpp" class DrawingContext; class Surface; @@ -37,21 +38,22 @@ class Font; */ 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 split(const std::string& text, int line_length); + static const std::vector 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