通过
pygame.display.set_caption("这是标题")
可以绘制窗口的标题
import pygame #导包
from pygame.locals import*
import sys
screen_width=600
screen_height=600
pygame.init() #初始化
screen = pygame.display.set_mode(size=(screen_width,screen_height))
pygame.display.set_caption("这是标题")
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()