Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8448 in orxonox.OLD for trunk/src/lib/graphics/text_engine/text.h


Ignore:
Timestamp:
Jun 15, 2006, 12:48:26 PM (18 years ago)
Author:
bensch
Message:

merged gui back to the trunk
merged with command
merge -r8377:HEAD https://svn.orxonox.net/orxonox/branches/gui .

File:
1 edited

Legend:

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

    r7919 r8448  
    88
    99#include "element_2d.h"
     10#include "color.h"
    1011
    1112#define  TEXT_ALIGN_LEFT             E2D_ALIGN_LEFT
     
    1314#define  TEXT_ALIGN_CENTER           E2D_ALIGN_CENTER
    1415#define  TEXT_ALIGN_SCREEN_CENTER    E2D_ALIGN_SCREEN_CENTER
    15 #define  TEXT_DEFAULT_COLOR          Vector(1.0, 1.0, 1.0)      //!< the default Color (white)
    16 #define  TEXT_DEFAULT_BLENDING       1.0f                       //!< the default blending of the text, (no blending at all)
     16#define  TEXT_DEFAULT_COLOR          Color(1.0, 1.0, 1.0, 1.0f) //!< the default Color (white, fully visible)
    1717
    1818#define  TEXT_DEFAULT_ALIGNMENT      TEXT_ALIGN_LEFT            //!< default alignment
     
    4444    void setFont(const std::string& fontFile, unsigned int renderSize);
    4545    /** @param blending the blending intensity to set (between 0.0 and 1.0) */
    46     inline void setBlending(float blending) { this->blending = blending; };
     46    inline void setBlending(float blending) { this->color.a() = blending; };
    4747    /** @param r red @param g green @param b blue @brief sets the Color of the Text to render (values in [0-1]) */
    48     void setColor(float r, float g, float b) { this->color = Vector(r, g, b); };
     48    void setColor(float r, float g, float b) { this->color = Color(r, g, b, this->color.a()); };
     49    void setColor(float r, float g, float b, float a) { this->color = Color(r, g, b, a); };
     50    void setColor(const Color& color) { this->color = color; };
    4951    void setSize(float size);
    5052
     
    5759    inline const Font* const getFont() const { return this->font; };
    5860    /** @returns the Blending Value [0 invisible 1.0 full visible */
    59     inline float getBlending() const { return this->blending; };
     61    inline float getBlending() const { return this->color.a(); };
    6062    /** @returns: a Vector(r,g,b) @brief: retrieve a Vector holding the Color of the Text */
    61     inline const Vector& getColor() const { return this->color; };
     63    inline const Color& getColor() const { return this->color; };
    6264    /** @returns the Size of the Text */
    6365    inline float getSize() const { return this->size; };
     
    7678
    7779    std::string       text;           //!< The text to display
    78     Vector            color;          //!< The color of the font.
    79     float             blending;       //!< The blending intensity.
     80    Color             color;          //!< The color of the font.
    8081    float             size;           //!< The size of the Text.
    8182};
Note: See TracChangeset for help on using the changeset viewer.