917f3f16ce592fb6be5b11b65328b938d16707fc
[supertux.git] / src / object / floating_image.hpp
1 #ifndef __FLOATING_IMAGE_H__
2 #define __FLOATING_IMAGE_H__
3
4 #include "game_object.hpp"
5 #include "math/vector.hpp"
6 #include "anchor_point.hpp"
7
8 class Sprite;
9
10 class FloatingImage : public GameObject
11 {
12 public:
13   FloatingImage(const std::string& sprite);
14   virtual ~FloatingImage();
15
16   void set_layer(int layer) {
17     this->layer = layer;
18   }
19   
20   int get_layer() const {
21     return layer;
22   }
23
24   void set_pos(const Vector& pos) {
25     this->pos = pos;
26   }
27   const Vector& get_pos() const {
28     return pos;
29   }
30   
31   void set_anchor_point(AnchorPoint anchor) {
32     this->anchor = anchor;
33   }
34   AnchorPoint get_anchor_point() const {
35     return anchor;
36   }
37
38   void set_visible(bool visible) {
39     this->visible = visible;
40   }
41   bool get_visible() const {
42     return visible;
43   }
44
45   void update(float elapsed_time);
46   void draw(DrawingContext& context);
47
48 private:
49   Sprite* sprite;
50   int layer;
51   bool visible;
52   AnchorPoint anchor;
53   Vector pos;
54 };
55
56 #endif
57