get_current_sketch()#

Get the py5 module’s current Sketch instance.

Examples#

1sketch = py5.get_current_sketch()
2assert sketch.is_ready
3py5.run_sketch(block=False)
4assert sketch.is_running
5py5.exit_sketch()
6assert sketch.is_dead

Description#

Get the py5 module’s current Sketch instance.

When coding py5 in module mode, a Sketch instance is created on your behalf that is referenced within the py5 module itself. That Sketch is called the “current sketch.” Use this method to access that Sketch instance directly.

Syntax#

get_current_sketch() -> Sketch

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