運行Python 3.3.0與pygame'1.9.2pre',遵循一個教程,新的python,誠實地不能看到我出了什麼地方,看起來像在教程上一樣,但它是4歲。感謝幫助!pygame.error不支持的圖像格式
我得到錯誤 - 兩種都不支持的圖像格式。我試過jpg和png,版本規範說它支持它們兩個。
bif ="bg.jpg"
mif ="man.jpg"
import pygame, sys
from pygame.locals import *
pygame.init()
screen = pygame.display.set_mode((1100,750),0,32)
background = pygame.image.load(bif).convert()
mouse_c = pygame.image.load(mif).convert_alpha()
Running = True
while Running:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
Running = False
sys.exit()
break
screen.blit(background,(0,0))
x,y = pygame.mouse.get_pos()
x -= mouse_r.get_width()/2
y -= mouse_r.get_height()/2
screen.blit(mouse_r,(x,y))
pygame.display.update()
什麼是'mouse_r'? – martineau