4 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #include "floating_image.hpp"
25 #include "object/floating_image.hpp"
30 FloatingImage::FloatingImage(const std::string& spritefile)
32 assert(Sector::current() != NULL);
33 floating_image = new _FloatingImage(spritefile);
34 Sector::current()->add_object(floating_image);
37 FloatingImage::~FloatingImage()
39 floating_image->remove_me();
40 // no delete here, Sector will do that
44 FloatingImage::set_layer(int layer)
46 floating_image->set_layer(layer);
50 FloatingImage::get_layer()
52 return floating_image->get_layer();
56 FloatingImage::set_pos(float x, float y)
58 floating_image->set_pos(Vector(x, y));
62 FloatingImage::get_pos_x()
64 return floating_image->get_pos().x;
68 FloatingImage::get_pos_y()
70 return floating_image->get_pos().y;
74 FloatingImage::set_anchor_point(int anchor)
76 floating_image->set_anchor_point((AnchorPoint) anchor);
80 FloatingImage::get_anchor_point()
82 return (int) floating_image->get_anchor_point();
86 FloatingImage::get_visible()
88 return floating_image->get_visible();
92 FloatingImage::set_visible(bool visible)
94 floating_image->set_visible(visible);