Changeset 8538 in orxonox.OLD for branches/gui/src/lib/graphics/text_engine/limited_width_text.h
- Timestamp:
- Jun 16, 2006, 4:36:12 PM (19 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/src/lib/graphics/text_engine/limited_width_text.h
r8529 r8538 1 1 /*! 2 * @file multi_line_text.h2 * @file limited_width_text.h 3 3 * @brief Definition of a text Class, that is able to render text. 4 4 */ 5 5 6 #ifndef _ MULTI_LINE_TEXT_H7 #define _ MULTI_LINE_TEXT_H6 #ifndef _LIMITED_WIDTH_TEXT_H 7 #define _LIMITED_WIDTH_TEXT_H 8 8 9 9 #include "text.h" … … 12 12 13 13 //! Represents one textElement. 14 class MultiLineText : public Text14 class LimitedWidthText : public Text 15 15 { 16 16 public: 17 MultiLineText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0); 17 typedef enum { 18 Begin, 19 End, 20 } DotsPosition; 21 22 23 public: 24 LimitedWidthText(const std::string& fontFile = "", unsigned int fontSize = TEXT_DEFAULT_SIZE, float lineWidth = 100.0, DotsPosition dotsPosition = Begin); 18 25 19 26 // Setup: 20 27 void setLineWidth(float lineWidth); 21 void set LineSpacing(float lineSpacing);28 void setDotsPosition(DotsPosition dotsPosition); 22 29 23 30 // Retrieve: 24 31 /** @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 32 inline float lineWidth() const { return this->_lineWidth; }; 33 /** @returns the dots position. */ 34 inline float dotsPosition() const { return this->_dotsPosition; }; 30 35 virtual void draw() const; 31 36 … … 36 41 37 42 private: 38 float lineWidth; 39 float lineSpacing; 40 std::vector<unsigned int> lineEnds; 41 unsigned int lineCount; 43 std::string _dotedText; 44 45 DotsPosition _dotsPosition; 46 float _lineWidth; 47 unsigned int _lineEnds; 42 48 }; 43 49 44 #endif /* _ MULTI_LINE_TEXT_H */50 #endif /* _LIMITED_WIDTH_TEXT_H */
Note: See TracChangeset
for help on using the changeset viewer.