diff options
Diffstat (limited to 'src/graphics/text.h')
-rw-r--r-- | src/graphics/text.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/graphics/text.h b/src/graphics/text.h index f60980c..a390e8a 100644 --- a/src/graphics/text.h +++ b/src/graphics/text.h @@ -10,13 +10,14 @@ namespace Graphics { Font &font_; const std::string text_; sf::VertexArray vertices_; + float lineHeightRatio_; unsigned int size_, maxWidth_, maxHeight_; void arrange(Font &font); // Specialize for sf::Font and TextureFont public: - Text(Font &font, const std::string &text, unsigned int maxWidth=0, - unsigned int maxHeight=0); + Text(Font &font, const std::string &text, float lineHeightRatio=1., + unsigned int maxWidth=0, unsigned int maxHeight=0); void setFont(Font &font); void setText(const std::string &text); @@ -26,11 +27,12 @@ namespace Graphics { }; template <typename Font> - Text<Font>::Text(Font &font, const std::string &text, + Text<Font>::Text(Font &font, const std::string &text, float lineHeightRatio, unsigned int maxWidth, unsigned int maxHeight) : font_(font) , text_(text) , vertices_(sf::Quads, text.size()*4) + , lineHeightRatio_(lineHeightRatio) , size_(0) , maxWidth_(maxWidth) , maxHeight_(maxHeight) |