render.DrawQuad
render.DrawQuad( Vector vert1, Vector vert2, Vector vert3, Vector vert4, table color = Color( 255, 255, 255 ) )
Description
Draws 2 connected triangles. Expects material to be set by render.SetMaterial.
This is a rendering function that requires a 3d rendering context.
This means that it will only work in 3d Rendering Hooks.
Arguments
Example
Draw a red half transparent quad facing upwards 150 units below the 0,0,0 of gm_construct.
local ourMat = Material( "vgui/white" ) -- Calling Material() every frame is quite expensive
hook.Add( "PostDrawTranslucentRenderables", "DrawQuad_Example", function()
render.SetMaterial( ourMat ) -- If you use Material, cache it!
render.DrawQuad( Vector( 0, 0, -150 ), Vector( 0, 100, -150 ),Vector( 100, 100, -150 ), Vector( 100, 0, -150 ), Color( 255, 0, 0, 128 ) )
end)