|
Last change
on this file since 8093 was
7757,
checked in by bensch, 19 years ago
|
|
orxonox/trunk: Resize of the Shell works quite nice
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file multi_line_text.h |
|---|
| 3 | * @brief Definition of a text Class, that is able to render text. |
|---|
| 4 | */ |
|---|
| 5 | |
|---|
| 6 | #ifndef _MULTI_LINE_TEXT_H |
|---|
| 7 | #define _MULTI_LINE_TEXT_H |
|---|
| 8 | |
|---|
| 9 | #include "text.h" |
|---|
| 10 | |
|---|
| 11 | #include <vector> |
|---|
| 12 | |
|---|
| 13 | //! Represents one textElement. |
|---|
| 14 | class MultiLineText : public Text |
|---|
| 15 | { |
|---|
| 16 | public: |
|---|
| 17 | MultiLineText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0); |
|---|
| 18 | |
|---|
| 19 | // Setup: |
|---|
| 20 | void setLineWidth(float lineWidth); |
|---|
| 21 | void setLineSpacing(float lineSpacing); |
|---|
| 22 | |
|---|
| 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; }; |
|---|
| 28 | inline unsigned int getLineCount() const { return this->lineCount; }; |
|---|
| 29 | |
|---|
| 30 | virtual void draw() const; |
|---|
| 31 | |
|---|
| 32 | void debug() const; |
|---|
| 33 | |
|---|
| 34 | protected: |
|---|
| 35 | virtual void setupTextWidth(); |
|---|
| 36 | |
|---|
| 37 | private: |
|---|
| 38 | float lineWidth; |
|---|
| 39 | float lineSpacing; |
|---|
| 40 | std::vector<unsigned int> lineEnds; |
|---|
| 41 | unsigned int lineCount; |
|---|
| 42 | }; |
|---|
| 43 | |
|---|
| 44 | #endif /* _MULTI_LINE_TEXT_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.