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: str

    The message of the text

  • x: float

    The x position of the text

  • y: float

    The y position of the text

  • size: float

    The font size

  • angle: float

    The rotation of the text

  • color: float, float, float, float

    The colour of the text

  • font: CODE | DEFAULT | SERIF | DISPLAY | PIXEL

    The 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.

Image Shape