🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for enter_buffer

Switch to drawing in a buffer. This is part of the reference section.

Purpose

Switch drawing targets such that transformations are still active but commands are recorded in an offscreen buffer instead. This will switch from the main drawing surface or canvas or from another buffer currently active to the buffer named.

Snippet

Create a buffer with transparent background called "example-buffer" which is 100 pixels wide and 50 pixels tall before starting to drawing in that buffer.
sketch.create_buffer('example-buffer', 100, 50)
sketch.enter_buffer('example-buffer')

Parameters

  • name: The name of the buffer to switch to.

Examples

Availability

Available for all platforms.

See also