在加载图像的mac错误上的Pygame

时间:2016-01-08 02:04:15

标签: python image macos bitmap pygame

我最近开始编写pygame编程,我使用python 3.5.1和最新的pygame,当我加载一个位图(bmp)时,它将它放在屏幕上就像这样

enter image description here

在学校,当我在电脑上编程时,它只能在我的macbook pro 13''与el capitain一起

import pygame    #imports pygame

width = 550     #width is 550

height = 420    #height is 420

size = width, height # size is a tuple

screen = pygame.display.set_mode(size)

white = 255,225,255 

screen.fill(white)

gameOn = True

mario = pygame.image.load("mario.bmp") #load the bitmap

marioflip = pygame.transform.flip(mario, True, True)

screen.blit(marioflip, (0,0)) # add it to screen

marioscale = pygame.transform.scale(mario, (50,50))

screen.blit(marioscale, (250,250))

mariorotate = pygame.transform.rotate(mario, 45)

screen.blit(mariorotate,(350,0))

while gameOn:

    for event in pygame.event.get():

        if event.type == pygame.QUIT: 

            pygame.quit()

    pygame.display.flip()

1 个答案:

答案 0 :(得分:0)

您在该版本的OS X上看到SDL_image中的已知错误。有关详细信息和解决方法,请参阅此链接:

https://bitbucket.org/pygame/pygame/issues/284/max-osx-el-capitan-using-the-deprecated