Skip to content

drawLabel()

Draw a line of text straight onto the display.

display.drawLabel(text, x, y)

This draws to the canvas and returns nothing, which is fast and best for text you will not change later. To keep a handle you can move or delete, create a Label and add() it instead. Erase these drawings with clearDrawing().

Parameters

display.drawLabel(text, x, y, color=Color.BLACK, font=None)
Parameter Type Default Description
text str required The text to draw.
x int or float required The horizontal position of the top-left corner, in pixels.
y int or float required The vertical position of the top-left corner, in pixels.
color Color Color.BLACK The text color.
font Font None The font, for example Font("Serif", Font.ITALIC, 16). If omitted, the default font is used.