pygame 问题

木鱼阿呆 2019-09-10 11:24:26
import pygame
import sys

#初始化oygame
pygame.init()


screen = pygame.display.set_mode(800,800)
pygame.display.set_caption('天公')

bg = (0,0,0)

#字体显示
font = pygame.font.Font(None,20)
line_height = font.get_linesize()
position = 0

screen.fill(bg)


while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()



screen.blit(font.render(str(event),True,(0,255,0),(0,position))
position += line_height


if position > height:
position = 0
screen.fill(bg)

pygeme.display.flip()



报错在 position += line_height 怎么解决
...全文
56 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
发错版块了,需要转到哪个版块?

603

社区成员

发帖
与我相关
我的任务
社区描述
客服专区
其他 技术论坛(原bbs)
社区管理员
  • 客服专区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧