render.SetScissorRect

From Garry's Mod
Jump to: navigation, search
 render.SetScissorRect( )

Contents

Description

Sets a scissoring rect which limits the drawing area.

Arguments

number startX

X start coordinate of the scissor rect.

Arguments

number startY

Y start coordinate of the scissor rect.

Arguments

number endX

X end coordinate of the scissor rect.

Arguments

number endY

Y end coordinate of the scissor rect.

Arguments

boolean enable

Enable or disable the scissor rect.

Examples

Example

Shows how to use this function. This will cut the white rectangle from full screen to 512x512 box in top left corner

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


Personal tools
Navigation