X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=lib%2Fvideo%2Ffont.h;h=429cf97e113004431e607b9fc856cd110db07871;hb=9599042661b468aae7bd34dca05441c0ebc93ad7;hp=3d1b9fc39fe9810b4009f3a3930a1fc6c5536ede;hpb=ca65a4babe2341f4c9b8952cfd516df8d74575e4;p=supertux.git diff --git a/lib/video/font.h b/lib/video/font.h index 3d1b9fc39..429cf97e1 100644 --- a/lib/video/font.h +++ b/lib/video/font.h @@ -23,12 +23,18 @@ #include -#include "../video/surface.h" -#include "../math/vector.h" +#include "video/surface.h" +#include "math/vector.h" namespace SuperTux { + enum { + LEFT_ALLIGN, + CENTER_ALLIGN, + RIGHT_ALLIGN + }; + /// Font class Font { @@ -60,13 +66,18 @@ namespace SuperTux /// returns the height of the font. float get_height() const; + /** Draws the given text to the screen. Also needs the position. + * Type of alignment, drawing effect and alpha are optional. */ + void draw(const std::string& text, const Vector& pos, + int allignment = LEFT_ALLIGN, + Uint32 drawing_effect = NONE_EFFECT, int alpha = 255); + private: friend class DrawingContext; - void draw(const std::string& text, const Vector& pos, - Uint32 drawing_effect = NONE_EFFECT, int alpha = 255); - void draw_center(const std::string& text, const Vector& pos, + void draw_text(const std::string& text, const Vector& pos, Uint32 drawing_effect = NONE_EFFECT, int alpha = 255); + void draw_chars(Surface* pchars, const std::string& text, const Vector& position, Uint32 drawing_effect, int alpha);