Welcome
Installation
Getting Started
User Interaction
Build a Game #1
Build a Game #2
Build a Game #3
Colours
Coordinates
API Reference
Globals
Window
Camera
Mouse
Key
Rect
Image
Text
Shape
Line
Screen
Sound
Base
Text
The Text class is for rendering text.
It is a subclass of Base.
__init__(content = "Text", x = 0, y = 0, size = 50, angle = 0, color = BLACK, font = DEFAULT)
Call the text initialiser.
content: strThe message of the text
x: floatThe x position of the text
y: floatThe y position of the text
size: floatThe font size
angle: floatThe rotation of the text
color: float, float, float, floatThe colour of the text
font: CODE | DEFAULT | SERIF | DISPLAY | PIXELThe font family
content: str
The message of the text.
size: float
The size of the font.
font: CODE | DEFAULT | SERIF | DISPLAY | PIXEL
The font family.
width: float
Get the measured width of the font.