bfb7db95e11b80c4206df6f4ac099879d3dd2851
[supertux.git] / src / scripting / floating_image.cpp
1 #include <config.h>
2
3 #include "floating_image.hpp"
4 #include "sector.hpp"
5 #include "object/floating_image.hpp"
6
7 namespace Scripting
8 {
9
10 FloatingImage::FloatingImage(const std::string& spritefile)
11 {
12   floating_image = new _FloatingImage(spritefile); 
13   Sector::current()->add_object(floating_image);
14 }
15
16 FloatingImage::~FloatingImage()
17 {
18   floating_image->remove_me();
19   // no delete here, Sector will do that
20 }
21
22 void
23 FloatingImage::set_layer(int layer)
24 {
25   floating_image->set_layer(layer);
26 }
27
28 int
29 FloatingImage::get_layer()
30 {
31   return floating_image->get_layer();
32 }
33
34 void
35 FloatingImage::set_pos(float x, float y)
36 {
37   floating_image->set_pos(Vector(x, y));
38 }
39
40 float
41 FloatingImage::get_pos_x()
42 {
43   return floating_image->get_pos().x;
44 }
45
46 float
47 FloatingImage::get_pos_y()
48 {
49   return floating_image->get_pos().y;
50 }
51
52 void
53 FloatingImage::set_anchor_point(int anchor)
54 {
55   floating_image->set_anchor_point((AnchorPoint) anchor);
56 }
57
58 int
59 FloatingImage::get_anchor_point()
60 {
61   return (int) floating_image->get_anchor_point();
62 }
63
64 bool
65 FloatingImage::get_visible()
66 {
67   return floating_image->get_visible();
68 }
69
70 void
71 FloatingImage::set_visible(bool visible)
72 {
73   floating_image->set_visible(visible);
74 }
75
76 }