get_graphics()

Get the Py5Graphics object used by the Sketch.

Examples

1
2
3
4
def setup():
    py5.rect(10, 10, 50, 50)
    g = py5.get_graphics()
    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 Java method: getGraphics

Syntax

get_graphics() -> Py5Graphics

Updated on September 11, 2021 16:51:34pm UTC