Garry's Mod Wiki

Revision Difference

render.SetScissorRect#513027

<function name="SetScissorRect" parent="render" type="libraryfunc">⤶ <description>Sets a scissoring rect which limits the drawing area.</description>⤶ <realm>Client</realm>⤶ <args>⤶ <arg name="startX" type="number">X start coordinate of the scissor rect.</arg>⤶ <arg name="startY" type="number">Y start coordinate of the scissor rect.</arg>⤶ <arg name="endX" type="number">X end coordinate of the scissor rect.</arg>⤶ <arg name="endY" type="number">Y end coordinate of the scissor rect.</arg>⤶ <arg name="enable" type="boolean">Enable or disable the scissor rect.</arg>⤶ </args>⤶ </function>⤶ ⤶ <example>⤶ <description>Shows how to use this function. This will cut the white rectangle from full screen to 512x512 box in top left corner</description>⤶ <code>⤶ render.SetScissorRect( 0, 0, 512, 512, true ) -- Enable the rect⤶ draw.RoundedBox( 4, 0, 0, ScrW(), ScrH(), color_white ) -- Draw a white rectangle over the whole screen⤶ render.SetScissorRect( 0, 0, 0, 0, false ) -- Disable after you are done⤶ </code>⤶ ⤶ </example>