Garry's Mod Wiki


  render.DrawScreenQuadEx( number startX, number startY, number width, number height )


Draws the current material set by render.SetMaterial to the area specified. Color cannot be customized.

See also render.DrawScreenQuad.

This is a rendering function that requires a 2d rendering context.

This means that it will only work in 2d Rendering Hooks.


1 number startX
X start position of the rect.
2 number startY
Y start position of the rect.
3 number width
Width of the rect.
4 number height
Height of the rect.


Example usage, draws a 256x256 rectangle with the wireframe material.

local ourMat = Material( "models/wireframe" ) hook.Add( "HUDPaint", "example_hook", function() render.SetMaterial( ourMat ) render.DrawScreenQuadEx( 100, 100, 256, 256 ) end )