Changeset 5122 in orxonox.OLD for trunk/src/lib/graphics/text_engine.h
- Timestamp:
- Aug 25, 2005, 2:07:12 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/text_engine.h
r5121 r5122 39 39 #define TEXT_ALIGN_CENTER E2D_ALIGN_CENTER 40 40 #define TEXT_ALIGN_SCREEN_CENTER E2D_ALIGN_SCREEN_CENTER 41 #define TEXT_DEFAULT_COLOR Vector(1.0, 1.0, 1.0) //!< the default Color (white) 42 #define TEXT_DEFAULT_BLENDING 1.0f //!< the default blending of the text, (no blending at all) 41 43 42 44 /* some default values */ 43 #define FONT_DEFAULT_SIZE 50//!< default size of the Text44 #define FONT_ DEFAULT_TEXT "orxonox 1234567890" //!< default text to display45 #define FONT_DEFAULT_COLOR_R 255 //!< default red part (color) of the text 46 #define FONT_ DEFAULT_COLOR_G 255 //!< default red green (color) of the text47 #define FONT_DEFAULT_COLOR_B 255 //!< default red blue (color) of the text 48 #define FONT_NUM_COLORS 256 //!< number of colors.49 50 #define FONT_HIGHEST_KNOWN_CHAR 128 //!< The highest character known to the textEngine. 51 52 #define TEXT_DEFAULT_ALIGNMENT TEXT_ALIGN_CENTER //!< default alignment 53 #define TEXT_STATIC 0 //!< Static Text 54 #define TEXT_DYNAMIC 1 //!< Dynamic Text 45 #define FONT_DEFAULT_SIZE 50 //!< default size of the Text 46 #define FONT_NUM_COLORS 256 //!< number of colors. 47 48 #define FONT_HIGHEST_KNOWN_CHAR 128 //!< The highest character known to the textEngine. 49 50 #define TEXT_DEFAULT_ALIGNMENT TEXT_ALIGN_CENTER //!< default alignment 51 52 typedef enum TEXT_RENDER_TYPE 53 { 54 TEXT_RENDER_STATIC = 1, 55 TEXT_RENDER_DYNAMIC = 2 56 }; 55 57 /** 56 58 * STATIC means: a font, that is only one GL-face. … … 103 105 class Text : public Element2D 104 106 { 105 friend class TextEngine;106 107 public: 108 Text(Font* font, TEXT_RENDER_TYPE type = TEXT_RENDER_DYNAMIC); 107 109 ~Text(); 108 110 109 void setType( inttype);110 void setText(const char* text );111 void setType(TEXT_RENDER_TYPE type); 112 void setText(const char* text, bool isExtern = false); 111 113 /** @param blending the blending intensity to set (between 0.0 and 1.0) */ 112 114 inline void setBlending(float blending) { this->blending = blending; }; … … 122 124 123 125 private: 124 Text(Font* font, int type = TEXT_DYNAMIC);125 126 126 static GLuint loadTexture(SDL_Surface* surface, TexCoord* texCoord); 127 127 static int powerOfTwo(int input); … … 130 130 Font* font; //!< Font of this text 131 131 132 inttype; //!< The type of this Font.132 TEXT_RENDER_TYPE type; //!< The type of this Font. 133 133 char* text; //!< The text to display 134 const char* externText; //!< the text to Display from an external Source. 134 135 Vector color; //!< The color of the font. 135 136 float blending; //!< The blending intensity. … … 207 208 Text* createText(const char* fontFile, 208 209 unsigned int fontSize = FONT_DEFAULT_SIZE, 209 int textType = TEXT_ DYNAMIC);210 int textType = TEXT_RENDER_DYNAMIC); 210 211 211 212 void debug() const;
Note: See TracChangeset
for help on using the changeset viewer.