Added an alpha argument for drawing fonts.
[supertux.git] / lib / video / drawing_context.h
index 4674234..c52e40f 100644 (file)
@@ -67,10 +67,10 @@ namespace SuperTux
                              Uint32 drawing_effect = NONE_EFFECT);
       /// Draws a text.
       void draw_text(Font* font, const std::string& text, const Vector& position,
-                     int layer, Uint32 drawing_effect = NONE_EFFECT);
+                     int layer, Uint32 drawing_effect = NONE_EFFECT, int alpha = 255);
       /// Draws aligned text.
       void draw_text_center(Font* font, const std::string& text,
-                            const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT);
+                            const Vector& position, int layer, Uint32 drawing_effect = NONE_EFFECT, int alpha = 255);
       /// Draws a color gradient onto the whole screen */
       void draw_gradient(Color from, Color to, int layer);
       /// Fills a rectangle.
@@ -129,6 +129,8 @@ namespace SuperTux
         {
           Font* font;
           std::string text;
+          bool center;
+          int alpha;
         };
 
       struct GradientRequest
@@ -161,6 +163,7 @@ namespace SuperTux
 
       void draw_surface_part(DrawingRequest& request);
       void draw_text(DrawingRequest& request);
+      void draw_text_center(DrawingRequest& request);
       void draw_gradient(DrawingRequest& request);
       void draw_filled_rect(DrawingRequest& request);