1 #ifndef ATHENA_NO_SAKURA
29 #include "Athena/Global.hpp"
42 class Sprite :
public QObject
45 Q_PROPERTY(QString name READ name WRITE setName)
46 Q_PROPERTY(qreal currentState READ currentState WRITE setCurrentState)
47 Q_PROPERTY(qreal stateCount READ stateCount CONSTANT)
55 virtual void setPosition(
const float x,
const float y);
57 virtual void setPosition(
const Vector2Df& pos);
59 void setName(
const std::string& name);
60 std::string name()
const;
62 virtual void setPosition(
const QPoint& pos);
63 virtual QPoint position()
const;
64 void setName(
const QString& name);
68 void addStateId(
int id);
76 void setStateIds(std::vector<int> ids);
78 std::vector<int> stateIds()
const;
80 QList<int> stateIds()
const;
82 atUint32 stateCount()
const;
83 void setCurrentState(atUint32
id);
84 atUint32 currentState()
const;
89 void setFrame(atUint32
id);
91 void setFrames(std::vector<SpriteFrame*> frames);
93 void setFrames(QList<SpriteFrame*> frames);
95 atUint32 frameCount()
const;
98 std::vector<SpriteFrame*> frames()
const;
100 QList<SpriteFrame*> frames()
const;
106 void setCurrentFrame(atUint32
id);
117 void nameChanged(QString);
118 void stateChanged(quint32);
122 #ifndef ATHENA_USE_QT
125 std::vector<int> m_stateIds;
126 std::vector<SpriteFrame*> m_frames;
130 QList<int> m_stateIds;
131 QList<SpriteFrame*> m_frames;
133 atUint32 m_currentState;
134 atUint32 m_currentFrame;
142 Q_DECLARE_METATYPE(Uint32)
143 Q_DECLARE_METATYPE(
Athena::Sakura::Sprite*)
146 #endif // SSPRITE_HPP
147 #endif // ATHENA_NO_SAKURA
int stateId(int index) const
Returns the texture id of a given state.