Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7737 in orxonox.OLD for trunk/src/lib/graphics/text_engine


Ignore:
Timestamp:
May 19, 2006, 11:38:34 PM (19 years ago)
Author:
bensch
Message:

Using MultiLine-Text in the Shell. This is much faster, and Nicer :)

Location:
trunk/src/lib/graphics/text_engine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/text_engine/multi_line_text.cc

    r7457 r7737  
    3232
    3333  this->lineSpacing = 1.0f;
     34  this->lineCount = 0;
    3435  this->setLineWidth(100.0f);
    3536}
     
    141142      width += this->getFont()->getGlyphArray()[this->getText()[i]]->advance;
    142143  }
     144
     145  this->lineCount = lineEnds.size()+1;
    143146  this->setSizeY2D((this->lineEnds.size()+1) * (this->lineSpacing + this->getFont()->getMaxHeight()));
    144147}
  • trunk/src/lib/graphics/text_engine/multi_line_text.h

    r7454 r7737  
    2626    /** @returns the LineSpacing */
    2727    inline float getLineSpacing() const { return this->lineSpacing; };
     28    inline unsigned int getLineCount() const { return this->lineCount; };
    2829
    2930    virtual void draw() const;
     
    3637    float                      lineSpacing;
    3738    std::vector<unsigned int>  lineEnds;
     39    unsigned int               lineCount;
    3840};
    3941
Note: See TracChangeset for help on using the changeset viewer.