txt_font = pygame.font.SysFont(None, 48)
txt_image = txt_font.render('Abc234', True, bg_color2, bg_color3)
txt_rect = txt_image.get_rect()
screen_image.blit(txt_image, txt_rect)
import sys
import pygame
pygame.init()
screen_image = pygame.display.set_mode((800, 600))
screen_rect = screen_image.get_rect()
pygame.display.set_caption('游戏窗口标题')
bg_color2 = (60, 60, 60)
bg_color3 = (255, 0, 0)
txt_font = pygame.font.SysFont(None, 48)
txt_image = txt_font.render('Abc234', True, bg_color2, bg_color3)
txt_rect = txt_image.get_rect()
screen_image.blit(txt_image, txt_rect)
pygame.display.flip()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()