Last change
on this file since 8965 was
7757,
checked in by bensch, 18 years ago
|
orxonox/trunk: Resize of the Shell works quite nice
|
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: |
---|
[7757] | 17 | MultiLineText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0); |
---|
[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 | |
---|
[7757] | 32 | void debug() const; |
---|
| 33 | |
---|
[7450] | 34 | protected: |
---|
| 35 | virtual void setupTextWidth(); |
---|
[5343] | 36 | |
---|
| 37 | private: |
---|
[7450] | 38 | float lineWidth; |
---|
| 39 | float lineSpacing; |
---|
| 40 | std::vector<unsigned int> lineEnds; |
---|
[7737] | 41 | unsigned int lineCount; |
---|
[1853] | 42 | }; |
---|
| 43 | |
---|
[7450] | 44 | #endif /* _MULTI_LINE_TEXT_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.