added morphs, fix some bugs, new images
added onAlienInRadius trigger but it not work right((
This commit is contained in:
53
aditem.h
53
aditem.h
@@ -2,37 +2,40 @@
|
||||
#define ADITEM_H
|
||||
|
||||
#include <QGraphicsItem>
|
||||
#include <QPainter>
|
||||
|
||||
class ADItem : public QGraphicsItem
|
||||
{
|
||||
public:
|
||||
enum adType {Alien, Tower, Splash};
|
||||
explicit ADItem(int id, adType type, QList<QImage *> *images, QRectF geometry = QRectF(), QGraphicsItem *parent = 0);
|
||||
explicit ADItem(QPoint id, QImage * image, QRectF geometry = QRectF(), QGraphicsItem *parent = 0);
|
||||
void setBarValue(float val) {barValue = val;}
|
||||
void setBarVisible(bool visible = true) {hasBar = visible;}
|
||||
void hideBar() {hasBar = false; setCacheMode(QGraphicsItem::ItemCoordinateCache);}
|
||||
float value() {return barValue;}
|
||||
bool isBarVisible() {return hasBar;}
|
||||
void next(float step);
|
||||
QPoint tid() {return m_tid;}
|
||||
int id() {return m_id;}
|
||||
adType itemType() {return m_type;}
|
||||
enum adType {Alien, Tower, Splash, Other};
|
||||
explicit ADItem(int id, adType type, QList<QImage *> *images, QRectF geometry = QRectF(), QGraphicsItem *parent = 0);
|
||||
explicit ADItem(QPoint id, QImage * image, QRectF geometry = QRectF(), QGraphicsItem *parent = 0);
|
||||
void setBarValue(float val) {barValue = val;}
|
||||
void setBarVisible(bool visible = true) {hasBar = visible;}
|
||||
void setCompositionMode(QPainter::CompositionMode mode) {cmode = mode;}
|
||||
void hideBar() {hasBar = false; setCacheMode(QGraphicsItem::ItemCoordinateCache);}
|
||||
float value() {return barValue;}
|
||||
bool isBarVisible() {return hasBar;}
|
||||
void next(float step = 1.f);
|
||||
QPoint tid() {return m_tid;}
|
||||
int id() {return m_id;}
|
||||
adType itemType() {return m_type;}
|
||||
QRectF boundingRect() const;
|
||||
|
||||
private:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QRectF boundingRect() const;
|
||||
QList<QImage *> * images;
|
||||
QImage * img;
|
||||
float anim;
|
||||
adType m_type;
|
||||
int m_id;
|
||||
QPoint m_tid;
|
||||
int animcount;
|
||||
bool staticImage;
|
||||
bool hasBar;
|
||||
float barValue;
|
||||
QRectF br;
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
QList<QImage *> * images;
|
||||
QImage * img;
|
||||
float anim;
|
||||
adType m_type;
|
||||
int m_id;
|
||||
QPoint m_tid;
|
||||
int animcount;
|
||||
bool staticImage;
|
||||
bool hasBar;
|
||||
float barValue;
|
||||
QRectF br;
|
||||
QPainter::CompositionMode cmode;
|
||||
};
|
||||
|
||||
#endif // ADITEM_H
|
||||
|
||||
Reference in New Issue
Block a user