hopefully fixed the crash on exit, keep sectors script bundled in the sector and...
[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 #include <memory>
8
9 class Sprite;
10
11 class FloatingImage : public GameObject
12 {
13 public:
14   FloatingImage(const std::string& sprite);
15   virtual ~FloatingImage();
16
17   void set_layer(int layer) {
18     this->layer = layer;
19   }
20   
21   int get_layer() const {
22     return layer;
23   }
24
25   void set_pos(const Vector& pos) {
26     this->pos = pos;
27   }
28   const Vector& get_pos() const {
29     return pos;
30   }
31   
32   void set_anchor_point(AnchorPoint anchor) {
33     this->anchor = anchor;
34   }
35   AnchorPoint get_anchor_point() const {
36     return anchor;
37   }
38
39   void set_visible(bool visible) {
40     this->visible = visible;
41   }
42   bool get_visible() const {
43     return visible;
44   }
45
46   void update(float elapsed_time);
47   void draw(DrawingContext& context);
48
49 private:
50   std::auto_ptr<Sprite> sprite;
51   int layer;
52   bool visible;
53   AnchorPoint anchor;
54   Vector pos;
55 };
56
57 #endif
58