get_graphics()#

Get the Py5Graphics object used by the Sketch.

Examples#

1def setup():
2    py5.rect(10, 10, 50, 50)
3    g = py5.get_graphics()
4    py5.println(type(g))

Description#

Get the Py5Graphics object used by the Sketch. Internally, all of Processing’s drawing functionality comes from interaction with PGraphics objects, and this will provide direct access to the PGraphics object used by the Sketch.

Underlying Processing method: getGraphics

Syntax#

get_graphics() -> Py5Graphics

Updated on November 12, 2021 11:30:58am UTC