🧪 Version 0.3.1 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 Sketch2DWeb

Renderer for browsers. This is part of the reference section.

Purpose

Renderer which can run inside an HTML document display like a browser.

Snippet

Create a new web sketch three different ways.
sketch_minimum = sketchingpy.Sketch2DWeb(500, 500)
sketch_custom_canvas = sketchingpy.Sketch2DWeb(500, 500, 'canvas-id')
sketch_custom_loading = sketchingpy.Sketch2DWeb(500, 500, 'canvas-id', 'loading-id')

Parameters

  • width: The horizontal size of the sketch in pixels.
  • height: The vertical size of the sketch in pixels.
  • target: Canvas element ID. Defaults to "sketch-canvas" if not given.
  • loading: Loading message element ID. Defaults to "sketch-load-message" if not given.

Availability

Only available in browser.

See also