class pygamepopup.components.TextElement(*args, **kwargs)

This class is representing a paragraph of text, displayed on a popup and horizontally centered according to its position.

Keyword Arguments:
  • text (str) – the text that should be rendered.

  • position (Position) – the position of the text on the screen.

  • font (pygame.font.Font) – the font that should be used to render the text.

  • margin (Margin) – a tuple containing the margins of the box, should be in the form “(top_margin, right_margin, bottom_margin, left_margin)”, defaults to (0, 0, 0, 0).

  • text_color (pygame.Color) – the color of the rendered text, defaults to WHITE.

  • column_span (int) – the number of columns the element should span, defaults to 1.