Started on GuiIcon, General fixes

This commit is contained in:
Bram Verhulst
2024-05-09 00:46:05 +02:00
parent d3b932df22
commit 8c3a485c2d
22 changed files with 231 additions and 409 deletions

View File

@@ -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;