gale.text module

This file contains render_text, a one-off helper to draw a string (optionally centered, with a background/drop shadow), and the class Text wrapping the same rendering as a reusable, movable object.

Author: Alejandro Mujica (aledrums@gmail.com)

gale.text.render_text(surface, text, font, x, y, color, bgcolor=None, center=False, shadowed=False)[source]
Parameters:
  • surface (Surface)

  • text (str)

  • font (Font)

  • x (float)

  • y (float)

  • color (Color)

  • bgcolor (Color | None)

  • center (bool)

  • shadowed (bool)

class gale.text.Text(text_str, font, x, y, color, bgcolor=None, center=False, shadowed=False)[source]

Bases: object

Parameters:
  • text_str (str)

  • font (Font)

  • x (float)

  • y (float)

  • color (Color)

  • bgcolor (Color | None)

  • center (bool)

  • shadowed (bool)

render(surface)[source]
Parameters:

surface (Surface)

Return type:

None