4 #include "resources.hpp"
6 #include "math/rect.hpp"
7 #include "sprite/sprite_manager.hpp"
8 #include "sprite/sprite.hpp"
9 #include "video/drawing_context.hpp"
10 #include "lisp/lisp.hpp"
11 #include "floating_image.hpp"
13 FloatingImage::FloatingImage(const std::string& spritefile)
14 : sprite(NULL), layer(LAYER_FOREGROUND1 + 1), visible(false),
17 sprite = sprite_manager->create(spritefile);
20 FloatingImage::~FloatingImage()
26 FloatingImage::update(float elapsed_time)
32 FloatingImage::draw(DrawingContext& context)
37 context.push_transform();
38 context.set_translation(Vector(0, 0));
40 Vector pos = get_anchor_pos(Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT),
41 sprite->get_width(), sprite->get_height(), anchor);
43 sprite->draw(context, pos, layer);
45 context.pop_transform();