🧪 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 set_rect_mode

Specify how Sketchingpy should interpret the position and size arguments. This is part of the reference section.

Purpose

Determine how arcs should be placed within the sketch and how they should be sized for rectangles. Available options:
  • center: Provide x and y coordinates followed by width and height.
  • radius: Provide x and y coordinates followed by half width and half height.
  • corner: Left and top coordinates followed by width and height.
  • corners: Left and top coordinates followed by right and bottom coordinates.
This modifies the interpretation of x1, y1, x2, and y2 but only for drawing rectangles.

Snippet

Indiciate that the rect parameters will be center X, center Y, width, and height.
sketch.set_rect_mode('center')

Parameters

  • mode: String describing the mode to use.

Examples

Availability

Available for all platforms.

See also