Revision Difference
surface.DrawTexturedRect#524657
<function name="DrawTexturedRect" parent="surface" type="libraryfunc">
<description>
Draw a textured rectangle with the given position and dimensions on the screen, using the current active texture set with <page>surface.SetMaterial</page>. It is also affected by <page>surface.SetDrawColor</page>.
See also <page>render.SetMaterial</page> and <page>render.DrawScreenQuadEx</page>.<br>
See also <page>surface.DrawTexturedRectUV</page>.
<rendercontext hook="false" type="2D"/>⤶
<rendercontext hook="false" type="2D"></rendercontext>⤶
</description>
<realm>Client and Menu</realm>
<args>
<arg name="x" type="number">The X integer co-ordinate.</arg>
<arg name="y" type="number">The Y integer co-ordinate.</arg>
<arg name="width" type="number">The integer width of the rectangle.</arg>
<arg name="height" type="number">The integer height of the rectangle.</arg>
</args>
</function>
<example>
<description>Draws a 512x512 textured rectangle with the wireframe texture.</description>
<code>
local ourMat = Material( "models/wireframe" ) -- Calling Material() every frame is quite expensive
hook.Add( "HUDPaint", "example_hook", function()
surface.SetDrawColor( 255, 255, 255, 255 )
surface.SetMaterial( ourMat ) -- If you use Material, cache it!
surface.DrawTexturedRect( 0, 0, 512, 512 )
end )
</code>
</example>