【发布时间】:2019-08-06 01:00:25
【问题描述】:
我在 pygame 加载图像时遇到问题。这是代码:
import pygame
pygame.init()
pygame.time.delay(900)
scr=pygame.display.set_mode((626,626))
pygame.display.update()
pygame.display.set_caption("Cricket")
bg=pygame.image.load('C:/Users/asus/Documents/Python Files/Cricket Application/bg.jpg').convert()
scr.blit(bg,(0,0))
while True:
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
break
当我运行它时,屏幕要么没有被填满,要么是底部的小块,要么是左边的块。
我不明白为什么会这样。
(图像与 .py 文件位于同一文件夹中) 任何帮助将不胜感激!
【问题讨论】:
标签: python-3.x image pygame