Counter Strike : Global Offensive Source Code
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.

73 lines
2.2 KiB

  1. //=========== (C) Copyright 1999 Valve, L.L.C. All rights reserved. ===========
  2. //
  3. // The copyright to the contents herein is the property of Valve, L.L.C.
  4. // The contents may be used and/or copied only with the written permission of
  5. // Valve, L.L.C., or in accordance with the terms and conditions stipulated in
  6. // the agreement/contract under which the contents have been supplied.
  7. //
  8. // $Header: $
  9. // $NoKeywords: $
  10. //
  11. //=============================================================================
  12. #ifndef TEXTDISPLAY_H
  13. #define TEXTDISPLAY_H
  14. #ifdef _WIN32
  15. #pragma once
  16. #endif
  17. #include "tier1/utlvector.h"
  18. // THIS CLASS IS A CHEAT AND SHOULD NOT REALLY BE
  19. // USED OUTSIDE OF GAME_CONTROLS LIB, BUT IT IS
  20. class CGameText;
  21. class IGameUISystem;
  22. class CGameUISystem;
  23. //-----------------------------------------------------------------------------
  24. // A class to display generic text on screen using the GameUI.
  25. // Static text hangs out on the right hand side, while messages hang out on the left side.
  26. // Not meant for real UI's, useful for spewing debugging info though!
  27. //-----------------------------------------------------------------------------
  28. class CTextDisplay
  29. {
  30. public:
  31. CTextDisplay();
  32. void Init( IGameUISystem *pMenu );
  33. // These hang around until you call ClearStaticText
  34. // Use this fxn if you want this class to just use in the next row below (like a list )
  35. void AddStaticText( const char* pFmt, ... );
  36. // Use this fxn if you want to supply a pixel position
  37. void AddStaticText( int xPos, int yPos, const char* pFmt, ... );
  38. // These get wiped every frame by calling Finish Frame, meant to be erased every frame loop.
  39. // Good for when you are updating the info every frame.
  40. // Use this fxn if you want this class to just use in the next row below (like a list )
  41. void PrintMsg( const char* pFmt, ... );
  42. // Use this fxn if you want to supply a pixel position
  43. void PrintMsg( int xPos, int yPos, const char* pFmt, ... );
  44. void ClearStaticText();
  45. void FinishFrame();
  46. void Shutdown();
  47. private:
  48. CUtlVector< CGameText * > m_pStaticText;
  49. CUtlVector< CGameText * > m_pStatsText;
  50. bool m_bIsInitialized;
  51. int m_nXStaticOffset;
  52. int m_nYStaticOffset;
  53. int m_nXOffset;
  54. int m_nYOffset;
  55. CGameUISystem *m_pMenu;
  56. };
  57. #endif // TEXTDISPLAY_H