Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/graphics/text_engine/limited_width_text.h @ 8626

Last change on this file since 8626 was 8619, checked in by bensch, 18 years ago

trunk: merged the gui-branche back.
merged with command:
svn merge -r8520:HEAD https://svn.orxonox.net/orxonox/branches/gui
no conflicts

File size: 1.2 KB
Line 
1/*!
2 * @file limited_width_text.h
3 * @brief Definition of a text Class, that is able to render text.
4 */
5
6#ifndef _LIMITED_WIDTH_TEXT_H
7#define _LIMITED_WIDTH_TEXT_H
8
9#include "text.h"
10
11#include <vector>
12
13//! Represents one textElement.
14class LimitedWidthText : public Text
15{
16  public:
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);
25
26    // Setup:
27    void setLineWidth(float lineWidth);
28    void setDotsPosition(DotsPosition dotsPosition);
29
30    // Retrieve:
31    /** @returns the LineWidth (maximum distance from the left to the right */
32    inline float lineWidth() const { return this->_lineWidth; };
33    /** @returns the dots position. */
34    inline float dotsPosition() const { return this->_dotsPosition; };
35
36    virtual void draw() const;
37
38    void debug() const;
39
40  protected:
41    virtual void setupTextWidth();
42
43  private:
44    std::string                _dotedText;
45
46    DotsPosition               _dotsPosition;
47    float                      _lineWidth;
48    unsigned int               _lineEnds;
49};
50
51#endif /* _LIMITED_WIDTH_TEXT_H */
Note: See TracBrowser for help on using the repository browser.