Reference for create_buffer
Create an off-screen buffer. This is part of the reference section.
Arc
Buffer
create_buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Create an "offscreen buffer" which can be used to save the results of drawing operations to memory, making them much faster to draw again later or in repetition. Note that buffers with opaque backgrounds may be more efficient in some renderers than buffers with transparent backgrounds.
Snippet
Create a buffer with transparent background called "example-buffer" which is 100 pixels wide and 50 pixels tall.
sketch.create_buffer('example-buffer', 100, 50)
Parameters
- name: The name of the buffer to create within the sketch.
- width: Width of the buffer in pixels.
- height: Height of the buffer in pixels.
- background: Optional color to use for the background of the buffer or None if fully transparent background. Defaults to None if not given.
Examples
Availability
Available for all platforms.