diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp | |
| download | archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.tar.xz archived-source-engine-2018-hl2-src-3bf9df6b2785fa6d951086978a3e66f49427166a.zip | |
Diffstat (limited to 'utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp')
| -rw-r--r-- | utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp b/utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp new file mode 100644 index 0000000..9f70f8c --- /dev/null +++ b/utils/vgui_panel_zoo/AnimatingImagePanelDemo.cpp @@ -0,0 +1,62 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// +#include "DemoPage.h" + +#include <VGUI/IVGui.h> + +#include <vgui_controls/Controls.h> +#include <vgui/IScheme.h> +#include <vgui_controls/AnimatingImagePanel.h> +#include <vgui/IImage.h> + +using namespace vgui; + +//----------------------------------------------------------------------------- +// An AnimatingImagePanel is a panel class that handles drawing of Animated Images and gives +// them all kinds of panel features. +//----------------------------------------------------------------------------- +class AnimatingImagePanelDemo: public DemoPage +{ + public: + AnimatingImagePanelDemo(Panel *parent, const char *name); + ~AnimatingImagePanelDemo(); + + private: + AnimatingImagePanel *m_pAnimImagePanel; +}; + +//----------------------------------------------------------------------------- +// Purpose: Constructor +//----------------------------------------------------------------------------- +AnimatingImagePanelDemo::AnimatingImagePanelDemo(Panel *parent, const char *name) : DemoPage(parent, name) +{ + // Create an Animating Image Panel + m_pAnimImagePanel = new AnimatingImagePanel(this, "AnAnimatingImagePanel"); + + // Each image file is named c1, c2, c3... c20, one image for each frame of the animation. + // This loads the 20 images in to the Animation class. + m_pAnimImagePanel->LoadAnimation("resource\\steam\\c", 20); + + // Set the position + m_pAnimImagePanel->SetPos(100, 100); + +} + +//----------------------------------------------------------------------------- +// Purpose: Destructor +//----------------------------------------------------------------------------- +AnimatingImagePanelDemo::~AnimatingImagePanelDemo() +{ +} + + + +Panel* AnimatingImagePanelDemo_Create(Panel *parent) +{ + return new AnimatingImagePanelDemo(parent, "AnimatingImagePanelDemo"); +} + |