00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef HEADER_SUPERTUX_OBJECT_MOVING_SPRITE_HPP
00018 #define HEADER_SUPERTUX_OBJECT_MOVING_SPRITE_HPP
00019
00020 #include "object/anchor_point.hpp"
00021 #include "supertux/moving_object.hpp"
00022 #include "util/reader_fwd.hpp"
00023 #include "video/drawing_request.hpp"
00024 #include "sprite/sprite_ptr.hpp"
00025
00029 class MovingSprite : public MovingObject
00030 {
00031 public:
00032 MovingSprite(const Vector& pos,
00033 const std::string& sprite_name,
00034 int layer = LAYER_OBJECTS,
00035 CollisionGroup collision_group = COLGROUP_MOVING);
00036 MovingSprite(const Reader& reader,
00037 const Vector& pos,
00038 int layer = LAYER_OBJECTS,
00039 CollisionGroup collision_group = COLGROUP_MOVING);
00040 MovingSprite(const Reader& reader,
00041 const std::string& sprite_name,
00042 int layer = LAYER_OBJECTS,
00043 CollisionGroup collision_group = COLGROUP_MOVING);
00044 MovingSprite(const Reader& reader,
00045 int layer = LAYER_OBJECTS,
00046 CollisionGroup collision_group = COLGROUP_MOVING);
00047 MovingSprite(const MovingSprite& moving_sprite);
00048
00049 ~MovingSprite();
00050
00051 virtual void draw(DrawingContext& context);
00052 virtual void update(float elapsed_time);
00053
00054 protected:
00055 std::string sprite_name;
00056 SpritePtr sprite;
00057 int layer;
00061 void set_action(const std::string& action, int loops);
00062
00066 void set_action_centered(const std::string& action, int loops);
00067
00071 void set_action(const std::string& action, int loops, AnchorPoint anchorPoint);
00072
00073 private:
00074
00075 MovingSprite& operator=(const MovingSprite&);
00076 };
00077
00078 #endif
00079
00080