22334db949baf94422197ba8fcc1a9519ac4a880
[supertux.git] / src / background.h
1 #ifndef __BACKGROUND_H__
2 #define __BACKGROUND_H__
3
4 #include "texture.h"
5 #include "game_object.h"
6 #include "drawable.h"
7
8 enum {
9   BACKGROUND_GRADIENT,
10   BACKGROUND_IMAGE
11 };
12
13 class DisplayManager;
14
15 class Background : public _GameObject, public Drawable
16 {
17 public:
18   Background(DisplayManager& displaymanager);
19   virtual ~Background();
20
21   void set_image(Surface* image, float bkgd_speed);
22
23   void set_gradient(Color top, Color bottom);
24
25   virtual std::string type() const
26   { return "Background"; }
27
28   virtual void action(float elapsed_time);
29
30   virtual void draw(ViewPort& viewport, int layer);
31
32 private:
33   int bgtype;
34   float speed;
35   Surface* image;
36   Color gradient_top, gradient_bottom;
37 };
38
39 #endif
40