Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Aug 25, 2005, 1:26:57 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: color is now a parameter of text not font

File:
1 edited

Legend:

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

    r5078 r5121  
    3434class PNode;
    3535class Font;
    36 template<class T> class tList;
    3736
    3837#define  TEXT_ALIGN_LEFT             E2D_ALIGN_LEFT
     
    113112  inline void setBlending(float blending) { this->blending = blending; };
    114113
    115   // Static Text
    116   void setColor(Uint8 r, Uint8 g, Uint8 b);
     114  /** sets the Color of the Text to render (values in [0-1]) @param r red @param g green @param b blue */
     115  void setColor(float r, float g, float b) { this->color = Vector(r,g,b); };
    117116
    118117  void createTexture();
     
    133132  int               type;           //!< The type of this Font.
    134133  char*             text;           //!< The text to display
    135   SDL_Color         color;          //!< The color of the font.
     134  Vector            color;          //!< The color of the font.
    136135  float             blending;       //!< The blending intensity.
    137136
     
    152151 public:
    153152  Font(const char* fontFile,
    154        unsigned int fontSize = FONT_DEFAULT_SIZE,
    155        Uint8 r = FONT_DEFAULT_COLOR_R,
    156        Uint8 g = FONT_DEFAULT_COLOR_G,
    157        Uint8 b = FONT_DEFAULT_COLOR_B);
     153       unsigned int fontSize = FONT_DEFAULT_SIZE);
    158154
    159155  virtual ~Font();
     
    162158  bool setFont(const char* fontFile);
    163159  void setSize(unsigned int fontSize);
    164   void setFastColor(Uint8 r, Uint8 g, Uint8 b);
    165160  void setStyle(const char* renderStyle);
    166161
    167162  /** @returns a Pointer to the Array of Glyphs */
    168   inline Glyph** getGlyphArray() const {return glyphArray;}
     163  inline Glyph** getGlyphArray() const { return glyphArray; };
    169164  /** @returns the texture to the fast-texture */
    170165  inline GLuint getFastTextureID() const {return fastTextureID;}
     
    195190  Glyph**       glyphArray;          //!< An Array of all the Glyphs stored in the Array of Glyphs.
    196191  GLuint        fastTextureID;       //!< The fast textureID.
    197   SDL_Color     fastColor;           //!< A Color for the fast Texture.
    198192
    199193  tList<Text>*  textList;            //!< A list of texts this Font is mapped to.
     
    213207  Text* createText(const char* fontFile,
    214208                   unsigned int fontSize = FONT_DEFAULT_SIZE,
    215                    int textType = TEXT_DYNAMIC,
    216                    Uint8 r = FONT_DEFAULT_COLOR_R,
    217                    Uint8 g = FONT_DEFAULT_COLOR_G,
    218                    Uint8 b = FONT_DEFAULT_COLOR_B);
     209                   int textType = TEXT_DYNAMIC);
    219210
    220211  void debug() const;
     
    228219  static void disableFonts();
    229220  static bool checkVersion();
    230 
    231  private:
    232   //  tList<Font>* fontList;
    233 
    234221};
    235222
Note: See TracChangeset for help on using the changeset viewer.