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

Draw text using the current font. This is part of the reference section.

Purpose

Draw text using the current font and alignment.

Snippet

Draw "Hello World" in 12 point IBM Plex Mono at x coordinate 50 and y coordinate 100.
sketch.set_text_font('./IBMPlexMono-Regular.ttf', 12)
sketch.draw_text(50, 100, 'Hello World')

Parameters

  • x: The x coordinate at which to draw the text.
  • y: The y coordinate at which to draw the text.
  • text: The string to draw.

Examples

Availability

Available for all platforms.

See also