Sets the clipping region in the draw state.
- The x coordinate of the upper left corner of the clipping rectangle.
- The y coordinate of the upper left corner of the clipping rectangle.
- The width of the clipping rectangle, in pixels.
- The height of the clipping rectangle, in pixels.
When the draw state has a clipping rectangle set, all draw operations will not affect any pixels in the graphics buffer outside of this rectangle. This is useful for reserving parts of the screen
When called without arguments, the function resets the clipping region to be the entire screen.
-- set the clipping region to exclude 8 pixels at the top and bottom clip(0, 8, 128, 116) -- these circles are clipped circfill(10, 10, 8, 8) circfill(10, 118, 8, 8) -- reset the clipping region to full screen clip() -- these circles are not clipped circfill(40, 10, 8, 7) circfill(40, 118, 8, 7)