drawLabel()
Draw a line of text straight onto the display.
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
Once an object display has been created, you can use the following functions:
display.drawLabel(text, x, y)
display.drawLabel(text, x, y, color, font, visibility)
| 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. |
visibility |
int |
100 |
How visible the label is, from 0 (invisible) to 100 (fully visible). |