From 868e729d68b5913716bfe5ddb512f4099851e9a2 Mon Sep 17 00:00:00 2001 From: Apickx Date: Mon, 28 Dec 2015 19:18:30 -0500 Subject: Initial commit --- gamemode/cl_hud/draw_functions.lua | 53 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 gamemode/cl_hud/draw_functions.lua (limited to 'gamemode/cl_hud/draw_functions.lua') diff --git a/gamemode/cl_hud/draw_functions.lua b/gamemode/cl_hud/draw_functions.lua new file mode 100644 index 0000000..6ad625d --- /dev/null +++ b/gamemode/cl_hud/draw_functions.lua @@ -0,0 +1,53 @@ + +local Grad = surface.GetTextureID("gui/gradient") + +function DrawBoxy(x,y,w,h,color) + draw.RoundedBox( 8, x, y, w, h, color ) +end + +function DrawText(text,font,x,y,color,bCentered) + draw.SimpleText( text, font, x, y, color, bCentered or 0, bCentered or 0 ) +end + +function DrawRect(x,y,w,h,color) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawRect( x, y, w, h ) +end + +function DrawOutlinedRect(x,y,w,h,color) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawOutlinedRect( x, y, w, h ) +end + +function DrawLeftGradient(x,y,w,h,color) + DrawTexturedRect(x,y,w,h,color,Grad) +end + +function DrawTexturedRect(x,y,w,h,color,texture) + surface.SetTexture( texture ) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawTexturedRect( x, y, w, h ) +end + +function DrawTexturedRectRotated(x,y,w,h,color,texture,rot) + surface.SetTexture( texture ) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawTexturedRectRotated( x, y, w, h, rot ) +end + +function DrawMaterialRect(x,y,w,h,color,material) + surface.SetMaterial( material ) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawTexturedRect( x, y, w, h ) +end + +function DrawMaterialRectRotated(x,y,w,h,color,material,rot) + surface.SetMaterial( material ) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawTexturedRectRotated( x, y, w, h, rot ) +end + +function DrawLine(x,y,x2,y2,color) + surface.SetDrawColor( color.r, color.g, color.b, color.a ) + surface.DrawLine( x, y, x2, y2 ) +end \ No newline at end of file -- cgit v1.2.3-70-g09d2