Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "DemoPage.h"
  8. #include <VGUI/IVGui.h>
  9. #include <vgui_controls/Controls.h>
  10. #include <vgui/IScheme.h>
  11. #include <vgui_controls/AnimatingImagePanel.h>
  12. #include <vgui/IImage.h>
  13. using namespace vgui;
  14. //-----------------------------------------------------------------------------
  15. // An AnimatingImagePanel is a panel class that handles drawing of Animated Images and gives
  16. // them all kinds of panel features.
  17. //-----------------------------------------------------------------------------
  18. class AnimatingImagePanelDemo: public DemoPage
  19. {
  20. public:
  21. AnimatingImagePanelDemo(Panel *parent, const char *name);
  22. ~AnimatingImagePanelDemo();
  23. private:
  24. AnimatingImagePanel *m_pAnimImagePanel;
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Purpose: Constructor
  28. //-----------------------------------------------------------------------------
  29. AnimatingImagePanelDemo::AnimatingImagePanelDemo(Panel *parent, const char *name) : DemoPage(parent, name)
  30. {
  31. // Create an Animating Image Panel
  32. m_pAnimImagePanel = new AnimatingImagePanel(this, "AnAnimatingImagePanel");
  33. // Each image file is named c1, c2, c3... c20, one image for each frame of the animation.
  34. // This loads the 20 images in to the Animation class.
  35. m_pAnimImagePanel->LoadAnimation("resource\\steam\\c", 20);
  36. // Set the position
  37. m_pAnimImagePanel->SetPos(100, 100);
  38. }
  39. //-----------------------------------------------------------------------------
  40. // Purpose: Destructor
  41. //-----------------------------------------------------------------------------
  42. AnimatingImagePanelDemo::~AnimatingImagePanelDemo()
  43. {
  44. }
  45. Panel* AnimatingImagePanelDemo_Create(Panel *parent)
  46. {
  47. return new AnimatingImagePanelDemo(parent, "AnimatingImagePanelDemo");
  48. }