render.SetScissorRect
From GMod Wiki
Function | |
Syntax |
render.SetScissorRect( Integer left, Integer top, Integer right, Integer bottom, Boolean enabled ) Where is this used? |
Description: | |
Sets up the scissor rectangle on the screen. Anything outside this rectangle is clipped and not rendered. Useful for writing gui stuff. | |
Returns: | nil |
Part of Library: | render |
Realm: | |
BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=Render.SetScissorRect]Render.SetScissorRect [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Description | Only draws things that are in the top-left half of the screen. |
---|---|
Used on | |
Code | render.SetScissorRect( 0, 0, ScrW() / 2, ScrH() / 2, true ) |
Output | N/A |
Additional Notes
- Remember to disable this after you're done scissoring what you need to.
- left = x
- top = y
- right = x + width
- bottom = y + height