diff options
| author | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
|---|---|---|
| committer | Apickx <Apickx@cogarr.org> | 2015-12-28 19:18:30 -0500 |
| commit | 868e729d68b5913716bfe5ddb512f4099851e9a2 (patch) | |
| tree | 6441108754145dfd68a6e23bea382b5cb1ab63d5 /gamemode/cl_hud/draw_functions.lua | |
| download | gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.tar.gz gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.tar.bz2 gearfox-868e729d68b5913716bfe5ddb512f4099851e9a2.zip | |
Diffstat (limited to 'gamemode/cl_hud/draw_functions.lua')
| -rw-r--r-- | gamemode/cl_hud/draw_functions.lua | 53 |
1 files changed, 53 insertions, 0 deletions
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 |
