## Description
Main graphics and rendering context, as well as the base `API` implementation for processing "core". Use this class if you need to draw into an off-screen graphics buffer. A Py5Graphics object can be constructed with the [](sketch_create_graphics) function. The [](py5graphics_begin_draw) and [](py5graphics_end_draw) methods (see example) are necessary to set up the buffer and to finalize it. The fields and methods for this class are extensive.
It is critically important that calls to this object's drawing methods are only used between [](py5graphics_begin_draw) and [](py5graphics_end_draw). Forgetting to call [](py5graphics_begin_draw) will likely result in an ugly and unhelpful Java exception.
To create a new graphics context, use the [](sketch_create_graphics) function. Do not use the syntax `Py5Graphics()`.
Underlying Processing class: [PGraphics](https://processing.org/reference/PGraphics.html)
The following methods and fields are provided:
```{include} include_py5graphics.md
```
Updated on March 06, 2023 02:49:26am UTC