Text
A brief reference to the Text class.
Last updated
Was this helpful?
A brief reference to the Text class.
Last updated
Was this helpful?
Text can be initialized like this:
You can get or change the text displayed with:
pyDraw will automatically calculate a width and height once you've created a Text object (or when you update it's attributes), so you can get those values like so:
You can access the font of the text with:
You can also modify the font-size as expected:
The width()
and height()
methods will only return the height of the text created as they are determined by text, font, and font-size, and cannot be set.
You can specify an alignment for cases where multiple lines of text are given:
Possible Values (string):
left
center
right
You can decorate text with the following methods: