source:
orxonox.OLD/trunk/src/lib/graphics/text_engine/limited_width_text.h
@
10181
Last change on this file since 10181 was 9869, checked in by bensch, 18 years ago | |
---|---|
File size: 1.3 KB |
Rev | Line | |
---|---|---|
[4838] | 1 | /*! |
[8538] | 2 | * @file limited_width_text.h |
[5343] | 3 | * @brief Definition of a text Class, that is able to render text. |
[7355] | 4 | */ |
[1853] | 5 | |
[8538] | 6 | #ifndef _LIMITED_WIDTH_TEXT_H |
7 | #define _LIMITED_WIDTH_TEXT_H | |
[1853] | 8 | |
[7450] | 9 | #include "text.h" |
[1853] | 10 | |
[7450] | 11 | #include <vector> |
[5343] | 12 | |
13 | //! Represents one textElement. | |
[8538] | 14 | class LimitedWidthText : public Text |
[5343] | 15 | { |
[9869] | 16 | ObjectListDeclaration(LimitedWidthText); |
[5343] | 17 | public: |
[8538] | 18 | typedef enum { |
19 | Begin, | |
20 | End, | |
21 | } DotsPosition; | |
[3245] | 22 | |
[8538] | 23 | |
24 | public: | |
25 | LimitedWidthText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0, DotsPosition dotsPosition = Begin); | |
26 | ||
[7450] | 27 | // Setup: |
28 | void setLineWidth(float lineWidth); | |
[8980] | 29 | void setDotsPosition(LimitedWidthText::DotsPosition dotsPosition); |
[5345] | 30 | |
[7450] | 31 | // Retrieve: |
32 | /** @returns the LineWidth (maximum distance from the left to the right */ | |
[8538] | 33 | inline float lineWidth() const { return this->_lineWidth; }; |
34 | /** @returns the dots position. */ | |
35 | inline float dotsPosition() const { return this->_dotsPosition; }; | |
[8542] | 36 | |
[5343] | 37 | virtual void draw() const; |
38 | ||
[7757] | 39 | void debug() const; |
40 | ||
[7450] | 41 | protected: |
42 | virtual void setupTextWidth(); | |
[5343] | 43 | |
44 | private: | |
[8538] | 45 | std::string _dotedText; |
46 | ||
47 | DotsPosition _dotsPosition; | |
48 | float _lineWidth; | |
49 | unsigned int _lineEnds; | |
[1853] | 50 | }; |
51 | ||
[8538] | 52 | #endif /* _LIMITED_WIDTH_TEXT_H */ |
Note: See TracBrowser
for help on using the repository browser.