# SetScissor

## Description

The function sets the area of the screen that will be drawn to in subsequent Sync() or Render() commands. The area is defined by two points representing the top left and bottom right corners of a rectangle which will be the new drawing area. By default this is set to your virtual resolution so anything placed outside this resolution is not be visible. Using SetScissor(0,0,0,0) is a special case that will turn off all clipping and make the full screen useable for displaying things. This can be useful when making an app that works across varying aspect ratios. For example using a virtual resolution of 1024x768 on a device with a 1280x800 screen would fit the 1024x768 area as closely as possible in the center of the screen, with black borders either side. SetScissor(0,0,0,0) places the 1024x768 area in the same place, but there are no black borders, so placing something at a negative X position would still be visible for as long as the screen can still fit it in. Whereas placing something at a negative position on a device with a 1024x768 screen (which fits your virtual resolution perfectly), would make that item disappear off the edge of the screen. You can use this with the commands GetScreenBoundsLeft, GetScreenBoundsRight, GetScreenBoundsTop, and GetScreenBoundsBottom to find the actual edge of the screen in your chosen resolution. This allows you to place items at the edge of the screen on all devices regardless of its aspect ratio.

## Definition

SetScissor( x, y, x2, y2 )

void agk::SetScissor( float x, float y, float x2, float y2 )

## Parameters

- x - The x component of the first coordinate.
- y - The y component of the first coordinate.
- x2 - The x component of the second coordinate.
- y2 - The y component of the second coordinate.