Fügen Sie Text zum Pygame -Fenster hinzu
import pygame, sys
from pygame.locals import *
pygame.init()
window = pygame.display.set_mode((600,400))
pygame.display.set_caption('Test')
fontSize = 40
font = pygame.font.SysFont('your font name', fontSize) #if you want to use the font you download use Font(), if not use SysFont()
def draw_text(text,x,y,color):
label = font.render(text, True, color)
window.blit(label, (x,y))
while True:
window.fill((50,50,50)) #you can put any color here
draw_text('your text',50,50,(255,255,255))
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
pygame.display.update()
The DevKid