Drawing text¶
Drawing programs often print various messages along with the pictures (you have probably seen many examples yourself). Here’s how to do that in PyGame:
1
import pygame as pg, petljapg
2
text = "PYTHON"
3
(width, height) = (len(text) * 70, 100)
4
canvas = petljapg.open_window(width, height, "Neon sign")
5
(PyGame__anim_text_eng)