diff options
| author | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-06-26 15:22:04 -0700 |
| commit | 39ed87570bdb2f86969d4be821c94b722dc71179 (patch) | |
| tree | abc53757f75f40c80278e87650ea92808274aa59 /mp/src/public/vgui_controls/AnimatingImagePanel.h | |
| download | source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip | |
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/public/vgui_controls/AnimatingImagePanel.h')
| -rw-r--r-- | mp/src/public/vgui_controls/AnimatingImagePanel.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/mp/src/public/vgui_controls/AnimatingImagePanel.h b/mp/src/public/vgui_controls/AnimatingImagePanel.h new file mode 100644 index 00000000..838d2eb5 --- /dev/null +++ b/mp/src/public/vgui_controls/AnimatingImagePanel.h @@ -0,0 +1,66 @@ +//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef ANIMATINGIMAGEPANEL_H
+#define ANIMATINGIMAGEPANEL_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <utlvector.h>
+#include <vgui_controls/Panel.h>
+
+namespace vgui
+{
+
+//-----------------------------------------------------------------------------
+// Purpose: Animating image
+//-----------------------------------------------------------------------------
+class AnimatingImagePanel : public Panel
+{
+ DECLARE_CLASS_SIMPLE( AnimatingImagePanel, Panel );
+
+public:
+ AnimatingImagePanel(Panel *parent, const char *name);
+
+ // Add an image to the end of the list of animations
+ // image - pointer to the image to add to the end of the list
+ virtual void AddImage(IImage *image);
+
+ // Load a set of animations by name.
+ // baseName - The name of the animations without their frame number or file extension, (e.g. c1.tga becomes just c.)
+ // framecount: number of frames in the animation
+ virtual void LoadAnimation(const char *baseName, int frameCount);
+
+ virtual void StartAnimation();
+ virtual void StopAnimation();
+ virtual void ResetAnimation(int frame = 0);
+
+protected:
+ virtual void OnTick();
+ virtual void PerformLayout();
+ virtual void PaintBackground();
+
+ virtual void GetSettings(KeyValues *outResourceData);
+ virtual void ApplySettings(KeyValues *inResourceData);
+ virtual const char *GetDescription();
+
+private:
+ int m_iCurrentImage;
+ int m_iNextFrameTime;
+ int m_iFrameTimeMillis;
+ CUtlVector<IImage *> m_Frames;
+ char *m_pImageName;
+ bool m_bAnimating;
+ bool m_bFiltered;
+ bool m_bScaleImage;
+};
+
+}; // namespace vgui
+
+#endif // ANIMATINGIMAGEPANEL_H
|