mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2026-02-04 14:09:20 +01:00
Started on GuiIcon, General fixes
This commit is contained in:
@@ -5,29 +5,20 @@ class Animation
|
||||
{
|
||||
public:
|
||||
Animation(Texture* pTexture, int frames, float frameDuration, Rectf srcRect, bool isLooping = true);
|
||||
~Animation() = default;
|
||||
|
||||
void Update(float elapsedSec);
|
||||
void Draw(const Vector2f& pos) const;
|
||||
void Draw(const Vector2f& pos, const Rectf& dst) const;
|
||||
|
||||
|
||||
void SetPlaying(bool isPlaying) {
|
||||
m_isPlaying = isPlaying;
|
||||
}
|
||||
void SetFlipped(bool isFlipped) {
|
||||
m_isFlipped = isFlipped;
|
||||
}
|
||||
|
||||
void Reset() {
|
||||
m_CurrentFrame = 0;
|
||||
m_hasPlayedOnce = false;
|
||||
m_isPlaying = true;
|
||||
m_FrameTimer = m_FrameDuration;
|
||||
}
|
||||
bool IsDone() const {
|
||||
return m_hasPlayedOnce && !m_isLooping;
|
||||
}
|
||||
void SetPlaying(bool isPlaying);
|
||||
void SetFlipped(bool isFlipped);
|
||||
|
||||
void Reset();
|
||||
bool IsDone() const;
|
||||
|
||||
int GetFrameCount() const;
|
||||
void SetFrame(int frame);
|
||||
|
||||
private:
|
||||
Texture* m_pTexture;
|
||||
|
||||
Reference in New Issue
Block a user