comparison engine/core/gui/base/gui_font.h @ 654:5d6b1820b953

* Added the ability to change screen modes on the fly. This works both in OpenGL and SDL modes. * Added IEngineChangeListener so the client can update the cameras viewport if the screen mode has been changed. I chose to do it this way because the engine has no way to know which camera it should update. It will be up to the client to do it. * The cursor surface is now correctly freed when exiting. * Added DeviceCaps::getNearestScreenMode() for the client to request a supported screen mode. closes[t:315]
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Thu, 21 Oct 2010 18:50:50 +0000
parents 47b49b9b0c0a
children
comparison
equal deleted inserted replaced
653:01acc9fc35ea 654:5d6b1820b953
41 /** Constructor 41 /** Constructor
42 * Takes the ownership of given font 42 * Takes the ownership of given font
43 */ 43 */
44 GuiFont(AbstractFont* font); 44 GuiFont(AbstractFont* font);
45 virtual ~GuiFont(); 45 virtual ~GuiFont();
46 46
47 int getStringIndexAt(const std::string& text, int x) const; 47 int getStringIndexAt(const std::string& text, int x) const;
48 void drawString(gcn::Graphics* graphics, const std::string& text, int x, int y); 48 void drawString(gcn::Graphics* graphics, const std::string& text, int x, int y);
49 void drawMultiLineString(gcn::Graphics* graphics, const std::string& text, int x, int y); 49 void drawMultiLineString(gcn::Graphics* graphics, const std::string& text, int x, int y);
50 std::string splitTextToWidth (const std::string& text, int render_width); 50 std::string splitTextToWidth (const std::string& text, int render_width);
51 51
59 Image* getAsImageMultiline(const std::string& text); 59 Image* getAsImageMultiline(const std::string& text);
60 void setColor(uint8_t r,uint8_t g,uint8_t b, uint8_t a = 255); 60 void setColor(uint8_t r,uint8_t g,uint8_t b, uint8_t a = 255);
61 SDL_Color getColor() const; 61 SDL_Color getColor() const;
62 int getWidth(const std::string& text) const; 62 int getWidth(const std::string& text) const;
63 int getHeight() const; 63 int getHeight() const;
64 64 void invalidate();
65
65 private: 66 private:
66 AbstractFont* m_font; 67 AbstractFont* m_font;
67 }; 68 };
68 } 69 }
69 70