kgoldrunner
kgrsprite.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef KGRSPRITE_H
00018 #define KGRSPRITE_H
00019
00020 #include <kgamecanvas.h>
00021
00022 #include <QPixmap>
00023 #include <QList>
00024
00025
00026 class KGrSprite : public KGameCanvasPixmap
00027 {
00028 public:
00029 explicit KGrSprite ( KGameCanvasAbstract* canvas = NULL);
00030 ~KGrSprite();
00031 void move(double x, double y, int frame);
00032 void setZ ( qreal z );
00033 void addFrames (QList<QPixmap> * frames, const QPoint & topLeft,
00034 const double scale);
00035 inline QPoint currentLoc() { return m_loc; }
00036 inline void clearFrames() { if (m_frames) m_frames->clear();}
00037 inline int currentFrame(){ return m_frame;}
00038 inline void setScale (double scale){ m_scale=scale;}
00039 inline double scale(){ return m_scale;}
00040
00041 private:
00042 QList<QPixmap> * m_frames;
00043 double m_scale;
00044 int m_frame;
00045 QPoint m_loc;
00046 int m_tlX;
00047 int m_tlY;
00048 };
00049
00050 #endif // KGRSPRITE_H