2020-02-15 16:33:18 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "irrlichttypes_extrabloated.h"
|
2020-03-16 22:56:48 +01:00
|
|
|
#include <string>
|
2020-02-15 16:33:18 +01:00
|
|
|
|
|
|
|
class ISimpleTextureSource;
|
|
|
|
|
|
|
|
class GUIAnimatedImage : public gui::IGUIElement {
|
|
|
|
public:
|
2020-03-16 22:56:48 +01:00
|
|
|
GUIAnimatedImage(gui::IGUIEnvironment *env, gui::IGUIElement *parent,
|
|
|
|
s32 id, const core::rect<s32> &rectangle, const std::string &texture_name,
|
|
|
|
s32 frame_count, s32 frame_duration, ISimpleTextureSource *tsrc);
|
2020-02-15 16:33:18 +01:00
|
|
|
|
|
|
|
virtual void draw() override;
|
|
|
|
|
2020-03-16 22:56:48 +01:00
|
|
|
void setFrameIndex(s32 frame);
|
|
|
|
s32 getFrameIndex() const { return m_frame_idx; };
|
|
|
|
|
2020-02-15 16:33:18 +01:00
|
|
|
private:
|
|
|
|
ISimpleTextureSource *m_tsrc;
|
|
|
|
|
2020-03-16 22:56:48 +01:00
|
|
|
video::ITexture *m_texture = nullptr;
|
|
|
|
u64 m_global_time = 0;
|
|
|
|
s32 m_frame_idx = 0;
|
|
|
|
s32 m_frame_count = 1;
|
|
|
|
u64 m_frame_duration = 1;
|
|
|
|
u64 m_frame_time = 0;
|
2020-02-15 16:33:18 +01:00
|
|
|
};
|