diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2017-09-06 23:40:09 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2017-09-06 23:40:09 -0400 |
| commit | 13a87c24b79ff4db6e1917409ce8a11b1d72b6e6 (patch) | |
| tree | 2a7f5c687156752ece42a601d0957147e4691e4c /gamemode | |
| parent | 9ba957b99603590b099f4bcd22a9cc86525dbcde (diff) | |
| download | artery-13a87c24b79ff4db6e1917409ce8a11b1d72b6e6.tar.gz artery-13a87c24b79ff4db6e1917409ce8a11b1d72b6e6.tar.bz2 artery-13a87c24b79ff4db6e1917409ce8a11b1d72b6e6.zip | |
Optomized health bar
Changed health bar to use fade materials instead of manually drawing
highlights/shadows.
Diffstat (limited to 'gamemode')
| -rw-r--r-- | gamemode/client/hud/cl_healthbar.lua | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/gamemode/client/hud/cl_healthbar.lua b/gamemode/client/hud/cl_healthbar.lua index 5655b1c..2705a42 100644 --- a/gamemode/client/hud/cl_healthbar.lua +++ b/gamemode/client/hud/cl_healthbar.lua @@ -138,19 +138,11 @@ hook.Add("HUDPaint", "HUD_DrawHealth", function() surface.SetDrawColor(150, 0, 0, 255) surface.DrawRect(xs, ys, barlength, barheight) --Heighlighting/shadows - local heighlightheight = barheight / 3 - - for k = 1, heighlightheight do - local perc = Lerp(k / heighlightheight, 100, 0) - surface.SetDrawColor(150 + perc, perc, perc, 255) - surface.DrawRect(xs, ys + k, barlength, 1) - end - - for k = 1, heighlightheight do - local perc = Lerp(k / heighlightheight, 0, 100) - surface.SetDrawColor(150 - perc, 0, 0, 255) - surface.DrawRect(xs, ys + k + (2 * heighlightheight), barlength, 1) - end + surface.SetTexture( surface.GetTextureID("gui/gradient.vtf") ) + surface.SetDrawColor( 0, 0, 0, 255 ) + surface.DrawTexturedRectRotated( xs + (barlength/2), ys + (barheight/4) * 3, barheight/2, barlength,90) + surface.SetDrawColor( 255, 255, 255, 50 ) + surface.DrawTexturedRectRotated( xs + (barlength/2), ys + (barheight/8), barheight/4, barlength,270) --Draw bubbles render.SetScissorRect(xs, ys, xs + barlength, ys + barheight, true) -- Enable the rect |
