src/object/moving_sprite.hpp

Go to the documentation of this file.
00001 //  SuperTux - MovingSprite Base Class
00002 //  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.de>
00003 //
00004 //  This program is free software: you can redistribute it and/or modify
00005 //  it under the terms of the GNU General Public License as published by
00006 //  the Free Software Foundation, either version 3 of the License, or
00007 //  (at your option) any later version.
00008 //
00009 //  This program is distributed in the hope that it will be useful,
00010 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 //  GNU General Public License for more details.
00013 //
00014 //  You should have received a copy of the GNU General Public License
00015 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
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   //MovingSprite& operator=(const MovingSprite& moving_sprite);
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   //MovingSprite(const MovingSprite&);
00075   MovingSprite& operator=(const MovingSprite&);
00076 };
00077 
00078 #endif
00079 
00080 /* EOF */

Generated on Mon Jun 9 03:38:19 2014 for SuperTux by  doxygen 1.5.1