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.

34 lines
1006 B

  1. #ifndef _INCLUDED_SOFT_LINE_H
  2. #define _INCLUDED_SOFT_LINE_H
  3. #ifdef _WIN32
  4. #pragma once
  5. #endif
  6. #include <vgui/VGUI.h>
  7. #include <vgui_controls/Panel.h>
  8. #include <vgui/ISurface.h>
  9. // this is a vgui panel that draws a line between opposite corners
  10. // the line is softened with translucent lines around it
  11. class SoftLine : public vgui::Panel
  12. {
  13. DECLARE_CLASS_SIMPLE( SoftLine, vgui::Panel );
  14. public:
  15. SoftLine(vgui::Panel *parent, const char *panelName, Color col);
  16. virtual void Paint();
  17. void DrawSoftLine(float x, float y, float x2, float y2, Color c);
  18. void SetCornerType(int i) { m_iCornerType = i; }
  19. Color m_Color;
  20. int m_iCornerType;
  21. static int s_nWhiteTexture;
  22. // draws a line between two points using polygon rather than line drawing functions (since line doesn't work sometimes)
  23. static void DrawPolygonLine(float x, float y, float x2, float y2, float width=1.0f);
  24. static void DrawPolygonLine(vgui::Vertex_t start, vgui::Vertex_t end, float width=1.0f);
  25. };
  26. #endif // _INCLUDED_SOFT_LINE_H