Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 24, 2006, 2:14:37 AM (19 years ago)
Author:
bensch
Message:

orxonox/font: nicer implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fontdata/src/lib/graphics/text_engine/text.h

    r8754 r8760  
    4545    void setFont(const std::string& fontFile, unsigned int renderSize);
    4646    /** @param blending the blending intensity to set (between 0.0 and 1.0) */
    47     inline void setBlending(float blending) { this->_color.a() = blending; };
     47    inline void setBlending(float blending) { this->_font.setTransparency(blending); };
    4848    /** @param r red @param g green @param b blue @brief sets the Color of the Text to render (values in [0-1]) */
    49     void setColor(float r, float g, float b) { this->_color = Color(r, g, b, this->_color.a()); };
    50     void setColor(float r, float g, float b, float a) { this->_color = Color(r, g, b, a); };
    51     void setColor(const Color& color) { this->_color = color; };
     49    void setColor(float r, float g, float b) { this->_font.setDiffuseColor(Color(r, g, b, this->blending())); };
     50    void setColor(float r, float g, float b, float a) { this->_font.setDiffuseColor(Color(r, g, b, a)); };
     51    void setColor(const Color& color) { this->_font.setDiffuseColor(color); };
    5252    void setSize(float size);
    5353
     
    6060    inline const Font& font() const { return this->_font; };
    6161    /** @returns the Blending Value [0 invisible 1.0 full visible */
    62     inline float blending() const { return this->_color.a(); };
     62    inline float blending() const { return this->_font.diffuseColor().a(); };
    6363    /** @returns: a Vector(r,g,b) @brief: retrieve a Vector holding the Color of the Text */
    64     inline const Color& color() const { return this->_color; };
     64    inline const Color& color() const { return this->_font.diffuseColor(); };
    6565    /** @returns the Size of the Text */
    6666    inline float size() const { return this->_size; };
     
    7979
    8080    std::string       _text;           //!< The text to display
    81     Color             _color;          //!< The color of the font.
    8281    float             _size;           //!< The size of the Text.
    8382};
Note: See TracChangeset for help on using the changeset viewer.