Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local vgui_white = Material("vgui/white")
- function draw.GradientV(x, y, w, h, col_a, col_b)
- render.SetMaterial(vgui_white)
- mesh.Begin(MATERIAL_QUADS, 1)
- mesh.Position(Vector(x, y, 0))
- mesh.Color(col_a:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x + w, y, 0))
- mesh.Color(col_a:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x + w, y + h, 0))
- mesh.Color(col_b:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x, y + h, 0))
- mesh.Color(col_b:Unpack())
- mesh.AdvanceVertex()
- mesh.End()
- end
- function draw.GradientH(x, y, w, h, col_a, col_b)
- render.SetMaterial(vgui_white)
- mesh.Begin(MATERIAL_QUADS, 1)
- mesh.Position(Vector(x + w, y, 0))
- mesh.Color(col_b:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x + w, y + h, 0))
- mesh.Color(col_b:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x, y + h, 0))
- mesh.Color(col_a:Unpack())
- mesh.AdvanceVertex()
- mesh.Position(Vector(x, y , 0))
- mesh.Color(col_a:Unpack())
- mesh.AdvanceVertex()
- mesh.End()
- end
Advertisement