source:
orxonox.OLD/trunk/src/lib/graphics/text_engine/multi_line_text.h
@
7737
Last change on this file since 7737 was 7737, checked in by bensch, 18 years ago | |
---|---|
File size: 1.1 KB |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
[7450] | 2 | * @file multi_line_text.h |
[5343] | 3 | * @brief Definition of a text Class, that is able to render text. |
[7355] | 4 | */ |
[1853] | 5 | |
[7450] | 6 | #ifndef _MULTI_LINE_TEXT_H |
7 | #define _MULTI_LINE_TEXT_H | |
[1853] | 8 | |
[7450] | 9 | #include "text.h" |
[1853] | 10 | |
[7450] | 11 | #include <vector> |
[5343] | 12 | |
13 | //! Represents one textElement. | |
[7450] | 14 | class MultiLineText : public Text |
[5343] | 15 | { |
16 | public: | |
[7450] | 17 | MultiLineText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE); |
[3245] | 18 | |
[7450] | 19 | // Setup: |
20 | void setLineWidth(float lineWidth); | |
[7454] | 21 | void setLineSpacing(float lineSpacing); |
[5345] | 22 | |
[7450] | 23 | // Retrieve: |
24 | /** @returns the LineWidth (maximum distance from the left to the right */ | |
25 | inline float getLineWidth() const { return this->lineWidth; }; | |
26 | /** @returns the LineSpacing */ | |
27 | inline float getLineSpacing() const { return this->lineSpacing; }; | |
[7737] | 28 | inline unsigned int getLineCount() const { return this->lineCount; }; |
[5367] | 29 | |
[5343] | 30 | virtual void draw() const; |
31 | ||
[7450] | 32 | protected: |
33 | virtual void setupTextWidth(); | |
[5343] | 34 | |
35 | private: | |
[7450] | 36 | float lineWidth; |
37 | float lineSpacing; | |
38 | std::vector<unsigned int> lineEnds; | |
[7737] | 39 | unsigned int lineCount; |
[1853] | 40 | }; |
41 | ||
[7450] | 42 | #endif /* _MULTI_LINE_TEXT_H */ |
Note: See TracBrowser
for help on using the repository browser.