summaryrefslogtreecommitdiff
path: root/game/client/tf/vgui/softline.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/vgui/softline.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/tf/vgui/softline.h')
-rw-r--r--game/client/tf/vgui/softline.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/game/client/tf/vgui/softline.h b/game/client/tf/vgui/softline.h
new file mode 100644
index 0000000..cbc9ec9
--- /dev/null
+++ b/game/client/tf/vgui/softline.h
@@ -0,0 +1,35 @@
+#ifndef _INCLUDED_SOFT_LINE_H
+#define _INCLUDED_SOFT_LINE_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include <vgui/VGUI.h>
+#include <vgui_controls/Panel.h>
+#include <vgui/ISurface.h>
+
+// this is a vgui panel that draws a line between opposite corners
+// the line is softened with translucent lines around it
+
+class SoftLine : public vgui::Panel
+{
+ DECLARE_CLASS_SIMPLE( SoftLine, vgui::Panel );
+public:
+ SoftLine(vgui::Panel *parent, const char *panelName, Color col);
+ virtual void Paint();
+ void DrawSoftLine(float x, float y, float x2, float y2, Color c);
+ void SetCornerType(int i) { m_iCornerType = i; }
+
+ Color m_Color;
+ int m_iCornerType;
+
+ static int s_nWhiteTexture;
+
+ // draws a line between two points using polygon rather than line drawing functions (since line doesn't work sometimes)
+ static void DrawPolygonLine(float x, float y, float x2, float y2, float width=1.0f);
+ static void DrawPolygonLine(vgui::Vertex_t start, vgui::Vertex_t end, float width=1.0f);
+};
+
+
+#endif // _INCLUDED_SOFT_LINE_H \ No newline at end of file